/* ETI Company Portal — Frontend Styles */

.eti-portal-wrap {
    width: 100%;
    max-width: 100%;
    font-family: inherit;
    color: #1a1a2e;
    box-sizing: border-box;
}

.eti-portal-notice {
    padding: 16px 20px;
    background: #f6f7f7;
    border-left: 4px solid #c3c4c7;
    border-radius: 3px;
    color: #646970;
}

/* ── Tabs ──────────────────────────────────────────────────────────── */

.eti-portal-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e5e7eb;
}

.eti-portal-tab {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #646970;
    transition: all 0.15s;
}

.eti-portal-tab:hover {
    color: #1a1a2e;
}

.eti-portal-tab.is-active {
    color: #c1292e;
    border-bottom-color: #c1292e;
}

.eti-portal-group.is-hidden {
    display: none;
}

/* ── Header ────────────────────────────────────────────────────────── */

.eti-portal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.eti-portal-group-title {
    font-size: 33px;
    font-weight: 700;
    margin: 0;
    color: #1a1a2e;
}

/* ── Buttons ───────────────────────────────────────────────────────── */

.eti-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    text-decoration: none;
}

.eti-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.eti-btn-primary {
    background: #c1292e;
    color: #fff;
}

.eti-btn-primary:hover:not(:disabled) {
    background: #a82228;
    color: #fff;
}

.eti-btn-secondary {
    background: #f0f0f0;
    color: #1a1a2e;
    font-size: 12px;
    padding: 6px 12px;
}

.eti-btn-secondary:hover:not(:disabled) {
    background: #e0e0e0;
}

/* ── Scorecard ─────────────────────────────────────────────────────── */

.eti-scorecard {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.eti-scorecard-widgets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.eti-widget {
    text-align: center;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.eti-widget-number {
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
    color: #1a1a2e;
    margin-bottom: 6px;
}

.eti-widget-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #646970;
}

.eti-widget-complete .eti-widget-number { color: #00a32a; }
.eti-widget-progress .eti-widget-number { color: #dba617; }
.eti-widget-notstarted .eti-widget-number { color: #646970; }

.eti-scorecard-bar-wrap {
    margin-top: 4px;
}

.eti-scorecard-bar-label {
    font-size: 13px;
    color: #646970;
    margin-bottom: 8px;
}

.eti-scorecard-bar-label strong {
    color: #1a1a2e;
}

.eti-scorecard-bar-track {
    height: 10px;
    background: #e5e7eb;
    border-radius: 99px;
    overflow: hidden;
}

.eti-scorecard-bar-fill {
    height: 100%;
    background: linear-gradient( 90deg, #c1292e, #e85d61 );
    border-radius: 99px;
    transition: width 0.6s ease;
}

/* ── Accordion ─────────────────────────────────────────────────────── */

.eti-portal-accordion {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.eti-member {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
    transition: box-shadow 0.15s;
}

.eti-member:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

.eti-member-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    cursor: pointer;
    gap: 16px;
    flex-wrap: wrap;
}

.eti-member-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.eti-member-name {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
}

.eti-member-meta {
    font-size: 12px;
    color: #646970;
}

.eti-member-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.eti-member-pct-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.eti-member-pct-bar {
    width: 80px;
    height: 6px;
    background: #e5e7eb;
    border-radius: 99px;
    overflow: hidden;
}

.eti-member-pct-fill {
    height: 100%;
    background: #c1292e;
    border-radius: 99px;
}

.eti-member-pct-label {
    font-size: 12px;
    font-weight: 700;
    color: #1a1a2e;
    min-width: 32px;
}

.eti-member-toggle {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #646970;
    padding: 4px;
    transition: transform 0.2s;
}

/* ── Status badges ─────────────────────────────────────────────────── */

.eti-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.eti-status-complete {
    background: #d1fae5;
    color: #065f46;
}

.eti-status-in_progress {
    background: #fef3c7;
    color: #92400e;
}

.eti-status-not_started {
    background: #f3f4f6;
    color: #6b7280;
}

/* ── Course table ──────────────────────────────────────────────────── */

.eti-member-courses {
    display: none;
    border-top: 1px solid #e5e7eb;
    padding: 0 20px 16px;
}

.eti-member.is-open .eti-member-courses {
    display: block;
}

.eti-courses-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 16px;
}

.eti-courses-table th {
    text-align: left;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #646970;
    border-bottom: 2px solid #e5e7eb;
}

.eti-courses-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
    color: #1a1a2e;
    vertical-align: middle;
}

.eti-courses-table tr:last-child td {
    border-bottom: none;
}

.eti-courses-table tr:hover td {
    background: #fafafa;
}

.eti-cert-link {
    color: #E2A041;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
}

.eti-cert-link:hover {
    text-decoration: underline;
}

.eti-muted {
    color: #9ca3af;
}

/* ── Responsive ────────────────────────────────────────────────────── */

@media ( max-width: 768px ) {
    .eti-scorecard-widgets {
        grid-template-columns: repeat( 2, 1fr );
    }

    .eti-member-header {
        flex-wrap: wrap;
    }

    .eti-portal-tabs {
        flex-wrap: wrap;
    }

    .eti-courses-table {
        display: block;
        overflow-x: auto;
    }
}

/* ── Dark button (replaces red for downloads) ─────────────────────── */

.eti-btn-dark {
    background: transparent;
    color: #1a1a2e;
    border: 2px solid #1a1a2e;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 18px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.eti-btn-dark:hover:not(:disabled) {
    background: #1a1a2e;
    color: #fff;
}

/* ── Section titles ───────────────────────────────────────────────── */

.eti-section-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 24px 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
}

/* ── Admin picker ─────────────────────────────────────────────────── */

.eti-admin-picker {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.eti-admin-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #f59e0b;
    margin: 0 0 10px;
}

.eti-admin-picker label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
}

.eti-admin-picker select {
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    min-width: 300px;
    cursor: pointer;
}

/* ── Orders table ─────────────────────────────────────────────────── */

.eti-orders-wrap {
    width: 100%;
    overflow-x: auto;
}

.eti-orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    font-family: inherit;
}

.eti-orders-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #646970;
    border-bottom: 2px solid #e5e7eb;
}

.eti-orders-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.eti-orders-table tr:last-child td {
    border-bottom: none;
}

.eti-orders-table tr:hover td {
    background: #fafafa;
}

.eti-order-number {
    font-weight: 700;
    color: #1a1a2e;
}

.eti-order-date {
    color: #646970;
    white-space: nowrap;
}

.eti-order-items {
    color: #1a1a2e;
    font-size: 15px;
}

.eti-order-total {
    font-weight: 700;
    color: #1a1a2e;
    white-space: nowrap;
}

.eti-order-link {
    color: #E2A041;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
}

.eti-order-link:hover {
    text-decoration: underline;
}

.eti-orders-empty,
.eti-orders-notice {
    padding: 16px;
    color: #646970;
    font-size: 14px;
}

.eti-orders-empty a {
    color: #E2A041;
    text-decoration: none;
    font-weight: 600;
}

/* ── My Courses table ─────────────────────────────────────────────── */

.eti-my-courses-wrap {
    width: 100%;
}

/* Filter tabs */
.eti-courses-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.eti-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 600;
    color: #646970;
    cursor: pointer;
    transition: all 0.15s;
}

.eti-filter-btn:hover {
    background: #e5e7eb;
    color: #1a1a2e;
}

.eti-filter-btn.is-active {
    background: #1a1a2e;
    border-color: #1a1a2e;
    color: #fff;
}

.eti-filter-count {
    display: inline-block;
    background: rgba(255,255,255,0.25);
    color: inherit;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 99px;
    min-width: 22px;
    text-align: center;
}

.eti-filter-btn:not(.is-active) .eti-filter-count {
    background: #e5e7eb;
    color: #646970;
}

.eti-filter-count-expired {
    background: #fee2e2 !important;
    color: #dc2626 !important;
}

/* Courses table */
.eti-courses-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    font-family: inherit;
}

.eti-courses-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #646970;
    border-bottom: 2px solid #e5e7eb;
}

.eti-courses-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.eti-courses-table tr:last-child td {
    border-bottom: none;
}

.eti-courses-table tr:hover td {
    background: #fafafa;
}

.eti-course-row.is-hidden {
    display: none;
}

/* Status column */
.eti-col-status {
    width: 36px;
    text-align: center;
}

.eti-status-check {
    font-size: 16px;
    font-weight: 700;
}

.eti-check-complete {
    color: #00a32a;
}

.eti-check-expired {
    color: #dc2626;
}

.eti-check-empty {
    color: #d1d5db;
}

/* Course title + sub-text */
.eti-course-title-link {
    color: #1a1a2e;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.4;
}

.eti-course-title-link:hover {
    color: #E2A041;
    text-decoration: underline;
}

.eti-course-sub {
    margin-top: 3px;
    font-size: 11px;
    font-style: italic;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.eti-course-sub-sep {
    color: #d1d5db;
}

.eti-expiry-expired {
    color: #dc2626 !important;
    font-weight: 600;
}

/* Type, CEUs columns */
.eti-col-type {
    font-size: 13px;
    color: #646970;
    min-width: 100px;
}

.eti-col-ceus {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    text-align: center;
    width: 60px;
}

.eti-col-cert {
    width: 110px;
    text-align: center;
}

/* Empty/notice states */
.eti-courses-empty,
.eti-courses-notice {
    padding: 16px;
    color: #646970;
    font-size: 14px;
}

.eti-courses-empty a {
    color: #E2A041;
    text-decoration: none;
    font-weight: 600;
}

/* Responsive */
@media ( max-width: 768px ) {
    .eti-col-type,
    .eti-col-ceus {
        display: none;
    }
}

/* ── CEU Total row ────────────────────────────────────────────────── */

.eti-ceu-total-row {
    border-top: 2px solid #e5e7eb;
}

.eti-ceu-total-label {
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #646970;
    text-align: right;
}

.eti-ceu-total-value {
    font-size: 16px !important;
    font-weight: 800 !important;
    color: #1a1a2e !important;
}

/* ── WC Account Page Customizations ──────────────────────────────── */

.eti-page-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 20px !important;
    padding: 0 !important;
    font-family: inherit;
}

.eti-readonly-names {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.eti-readonly-field {
    flex: 1;
    min-width: 200px;
}

.eti-readonly-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #646970;
    margin-bottom: 6px;
    font-family: inherit;
}

.eti-readonly-value {
    padding: 10px 14px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 15px;
    color: #1a1a2e;
    margin: 0;
    font-family: inherit;
    cursor: not-allowed;
}

.eti-locked-note {
    display: block;
    font-size: 11px;
    color: #9ca3af;
    font-style: italic;
    margin-top: 4px;
}

.eti-locked-note-row {
    width: 100%;
    clear: both;
    margin: -12px 0 16px !important;
    padding: 0 !important;
}

/* ── Credentials on File ──────────────────────────────────────────── */

.eti-creds-section {
    margin-top: 16px;
    padding: 16px 12px 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.eti-creds-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.eti-creds-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #646970;
    margin: 0;
}

.eti-creds-grid {
    display: grid;
    grid-template-columns: repeat( auto-fill, minmax( 180px, 1fr ) );
    gap: 10px 16px;
}

.eti-cred-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.eti-cred-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #9ca3af;
}

.eti-cred-value {
    font-size: 13px;
    font-weight: 500;
    color: #1a1a2e;
    word-break: break-all;
}

.eti-cred-input {
    width: 100%;
    padding: 5px 8px;
    font-size: 13px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    color: #1a1a2e;
    box-sizing: border-box;
    font-family: inherit;
}

.eti-cred-input:focus {
    outline: none;
    border-color: #c1292e;
    box-shadow: 0 0 0 2px rgba( 193, 41, 46, 0.12 );
}

.eti-creds-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.eti-creds-empty {
    font-size: 13px;
    color: #9ca3af;
    margin: 0;
    font-style: italic;
}

.eti-cred-state-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.eti-cred-state-row .eti-cred-label {
    flex-shrink: 0;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #9ca3af;
}

.eti-state-select {
    padding: 5px 10px;
    font-size: 13px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    color: #1a1a2e;
    font-family: inherit;
    cursor: pointer;
    flex: 1;
    min-width: 160px;
    max-width: 260px;
}

.eti-state-select:focus {
    outline: none;
    border-color: #c1292e;
    box-shadow: 0 0 0 2px rgba( 193, 41, 46, 0.12 );
}

.eti-cred-group-label,
.eti-cred-group-national .eti-cred-group-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #646970;
    margin: 14px 0 8px;
}

.eti-cred-group-national {
    margin-top: 4px;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
}

.eti-creds-msg {
    font-size: 12px;
}

/* ── Credential checklist (edit mode) ────────────────────────────── */

.eti-cred-checklist {
    display: grid;
    grid-template-columns: repeat( 2, 1fr );
    column-gap: 16px;
    row-gap: 6px;
    margin: 4px 0 8px;
}

.eti-cred-type-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #3c434a;
    user-select: none;
}

.eti-cred-type-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin: 0;
    flex-shrink: 0;
    accent-color: #c1292e;
    cursor: pointer;
}

.eti-cred-number-row {
    padding: 5px 0 4px 23px;
}

.eti-cred-number-row .eti-cred-input {
    max-width: 220px;
}

.eti-msg-error {
    color: #dc2626;
}

.eti-msg-success {
    color: #00a32a;
}

/* ── Profile photo — account page upload UI ──────────────────────── */

.eti-photo-wrap {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.eti-photo-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.eti-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.eti-photo-initials {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
}

.eti-photo-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.eti-photo-btn {
    display: inline-block;
    padding: 7px 14px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
}

.eti-photo-btn:hover,
.eti-photo-btn.is-loading {
    background: #e5e7eb;
}

.eti-photo-remove-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    color: #9ca3af;
    cursor: pointer;
    text-decoration: underline;
}

.eti-photo-remove-btn:hover {
    color: #c1292e;
}

.eti-photo-msg {
    font-size: 12px;
}

/* ── Profile photo — portal member avatar ─────────────────────────── */

.eti-member-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 4px;
}

.eti-member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.eti-member-avatar span {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
}

/* ── FASA/BASA Badge ──────────────────────────────────────────────── */

.eti-badge-pill {
    display: inline-block;
    background: #1a1a2e;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 99px;
    margin-left: 8px;
    vertical-align: middle;
    letter-spacing: 0.03em;
}

.eti-badge-pill-expired {
    background: #dc2626;
}

.eti-badge-download-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 12px;
    margin-top: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    flex-wrap: wrap;
    gap: 10px;
}

.eti-badge-download-info {
    font-size: 14px;
    color: #1a1a2e;
}

.eti-badge-expiry {
    font-size: 13px;
    color: #646970;
    margin-left: 4px;
}

.eti-badge-download-btn {
    flex-shrink: 0;
}
