/* ═══════════════════════════════════════════════════════════════════
   ESAC Member Registration – Complete Public CSS  v1.0.0
═══════════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Reset / Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --c-dark:    #0d2136;
    --c-blue:    #1a6fc4;
    --c-blue-lt: #eff6ff;
    --c-green:   #10b981;
    --c-red:     #ef4444;
    --c-amber:   #f59e0b;
    --c-purple:  #8b5cf6;
    --c-border:  #e2e8f0;
    --c-bg:      #f8fafc;
    --c-text:    #1e293b;
    --c-muted:   #64748b;
    --c-white:   #ffffff;
    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 4px rgba(0,0,0,.06);
    --shadow:    0 2px 14px rgba(0,0,0,.09);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.13);
    --trans:     .18s ease;
}

.emr-wrap, .emr-dash, .emr-profile-wrap, .emr-login-wrap {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--c-text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════════════════════════════
   REGISTRATION / PROFILE WRAP
═══════════════════════════════════════════════════════════════════ */
.emr-wrap {
    background: var(--c-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--c-border);
    max-width: 880px;
    margin: 0 auto 40px;
    overflow: hidden;
}

/* ── Step Tabs ────────────────────────────────────────────────── */
.emr-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 16px 24px 12px;
    background: var(--c-white);
    border-bottom: 1px solid var(--c-border);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(8px);
}

.emr-tab {
    padding: 6px 15px;
    border-radius: 20px;
    border: 1.5px solid var(--c-border);
    background: var(--c-white);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--c-muted);
    cursor: pointer;
    font-family: inherit;
    transition: all var(--trans);
    white-space: nowrap;
    line-height: 1.4;
}
.emr-tab:hover { color: var(--c-text); border-color: #93c5fd; background: var(--c-blue-lt); }
.emr-tab--active { background: var(--c-dark); color: var(--c-white); border-color: var(--c-dark); font-weight: 600; }

/* ── Steps / Sections ─────────────────────────────────────────── */
.emr-steps { padding: 28px 28px 0; }
.emr-step, .emr-profile-section { display: none; animation: emr-fade .2s ease; }
.emr-step--active, .emr-profile-section--active { display: block; }

@keyframes emr-fade { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }

.emr-step__title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--c-dark);
    letter-spacing: -.3px;
}
.emr-step__note {
    font-size: 13.5px;
    color: var(--c-blue);
    margin: -10px 0 18px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Field Grid ───────────────────────────────────────────────── */
.emr-fields--grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 22px;
    margin-bottom: 4px;
}
.emr-field { display: flex; flex-direction: column; gap: 5px; }
.emr-field--full { grid-column: 1 / -1; }
.emr-field--half { grid-column: span 1; }

.emr-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--c-text);
    display: flex;
    align-items: center;
    gap: 3px;
}
.emr-req { color: var(--c-red); font-weight: 700; }

/* ── Inputs ───────────────────────────────────────────────────── */
.emr-input {
    width: 100%;
    padding: 9px 13px;
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--c-text);
    background: var(--c-white);
    transition: border-color var(--trans), box-shadow var(--trans), background var(--trans);
    appearance: none;
    line-height: 1.4;
}
.emr-input::placeholder { color: #94a3b8; }
.emr-input:focus {
    outline: none;
    border-color: var(--c-blue);
    box-shadow: 0 0 0 3px rgba(26,111,196,.12);
    background: var(--c-blue-lt);
}
.emr-input--error { border-color: var(--c-red) !important; background: #fff5f5 !important; }
.emr-input[readonly] { background: var(--c-bg); color: var(--c-muted); cursor: not-allowed; }

.emr-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' fill='none' viewBox='0 0 12 7'%3E%3Cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
    cursor: pointer;
}
.emr-textarea { resize: vertical; min-height: 90px; }

.emr-field-error { font-size: 11.5px; color: var(--c-red); margin-top: 3px; display: flex; align-items: center; gap: 4px; }

/* ── Password ─────────────────────────────────────────────────── */
.emr-pw-wrap { position: relative; display: flex; align-items: center; }
.emr-pw-input { padding-right: 48px; flex: 1; }
.emr-pw-toggle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 44px;
    background: #1a6fc4;
    border: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    cursor: pointer;
    color: #fff;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--trans);
    flex-shrink: 0;
    z-index: 2;
    padding: 0;
    line-height: 1;
}
.emr-pw-toggle:hover { background: #145aad; }
.emr-pw-toggle:focus { outline: 2px solid #93c5fd; outline-offset: 1px; }

.emr-pw-strength { margin-top: 6px; }
.emr-pw-strength__bar { height: 4px; background: var(--c-border); border-radius: 4px; overflow: hidden; margin-bottom: 4px; }
.emr-pw-strength__bar span { display: block; height: 100%; border-radius: 4px; width: 0; transition: width .4s ease, background .4s ease; }
.emr-pw-strength__label { font-size: 11px; color: var(--c-muted); font-weight: 500; }

.emr-pw-strength--weak   .emr-pw-strength__bar span { width: 33%; background: var(--c-red); }
.emr-pw-strength--weak   .emr-pw-strength__label    { color: var(--c-red); }
.emr-pw-strength--medium .emr-pw-strength__bar span { width: 66%; background: var(--c-amber); }
.emr-pw-strength--medium .emr-pw-strength__label    { color: var(--c-amber); }
.emr-pw-strength--strong .emr-pw-strength__bar span { width: 100%; background: var(--c-green); }
.emr-pw-strength--strong .emr-pw-strength__label    { color: var(--c-green); }

/* ── Account-Type Cards ───────────────────────────────────────── */
.emr-fields--cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 4px;
}
.emr-card-option { cursor: pointer; display: block; }
.emr-radio-hidden { display: none; }

.emr-card-option__inner {
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius);
    padding: 16px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    transition: border-color var(--trans), box-shadow var(--trans), background var(--trans);
    background: var(--c-white);
    min-height: 115px;
    position: relative;
}
.emr-card-option__inner:hover { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(26,111,196,.08); }
.emr-card-option--selected .emr-card-option__inner {
    border-color: var(--c-dark);
    background: #f0f4f8;
    box-shadow: 0 0 0 3px rgba(13,33,54,.08);
}
.emr-card-option--selected .emr-card-option__inner::after {
    content: '✓';
    position: absolute; top: 10px; right: 12px;
    width: 20px; height: 20px;
    background: var(--c-dark); color: #fff;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; line-height: 20px; text-align: center;
}
.emr-card-option__icon { font-size: 20px; color: var(--c-dark); }
.emr-card-option__title { font-size: 13.5px; font-weight: 700; color: var(--c-text); line-height: 1.3; }
.emr-card-option__desc  { font-size: 11.5px; color: var(--c-blue); line-height: 1.4; }

/* ── Toggle Pills (Preferences) ───────────────────────────────── */
.emr-fields--toggles { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.emr-toggle-pill {
    padding: 7px 16px;
    border-radius: 20px;
    border: 1.5px solid var(--c-border);
    background: var(--c-white);
    font-size: 13px;
    font-weight: 500;
    color: var(--c-text);
    cursor: pointer;
    font-family: inherit;
    transition: all var(--trans);
    line-height: 1.3;
}
.emr-toggle-pill:hover { border-color: #93c5fd; background: var(--c-blue-lt); }
.emr-toggle-pill--active { background: var(--c-dark); color: var(--c-white); border-color: var(--c-dark); font-weight: 600; }

/* ── File Upload ──────────────────────────────────────────────── */
.emr-file-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 2px dashed var(--c-border);
    border-radius: var(--radius);
    padding: 28px 16px;
    cursor: pointer;
    text-align: center;
    transition: border-color var(--trans), background var(--trans);
}
.emr-file-drop:hover { border-color: var(--c-blue); background: var(--c-blue-lt); }
.emr-file-drop__icon { font-size: 24px; color: var(--c-blue); }
.emr-file-drop__label { font-size: 13.5px; font-weight: 500; color: var(--c-blue); }
.emr-file-drop--done { border-color: var(--c-green); background: #f0fdf4; }
.emr-file-drop--done .emr-file-drop__icon,
.emr-file-drop--done .emr-file-drop__label { color: var(--c-green); }

.emr-doc-upload-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-bottom: 12px; }
.emr-doc-upload-card { display: flex; flex-direction: column; gap: 6px; }
.emr-doc-view-link { font-size: 12px; color: var(--c-blue); text-decoration: none; display: flex; align-items: center; gap: 4px; justify-content: center; }
.emr-doc-view-link:hover { text-decoration: underline; }

/* ── Review Summary ───────────────────────────────────────────── */
.emr-review { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
.emr-review-section { background: var(--c-bg); border-radius: var(--radius-sm); padding: 14px 16px; border: 1px solid var(--c-border); }
.emr-review-section h4 { font-size: 11px; font-weight: 700; color: var(--c-dark); text-transform: uppercase; letter-spacing: .7px; margin-bottom: 10px; }
.emr-review-row { display: flex; gap: 10px; font-size: 13px; padding: 3px 0; }
.emr-review-row__key { font-weight: 600; min-width: 130px; color: var(--c-text); flex-shrink: 0; }
.emr-review-row__val { color: var(--c-muted); }

/* ── Navigation ───────────────────────────────────────────────── */
.emr-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0 28px;
    margin-top: 22px;
    border-top: 1px solid var(--c-border);
}
.emr-nav__right { display: flex; gap: 10px; align-items: center; }

/* ── Buttons ──────────────────────────────────────────────────── */
.emr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: background var(--trans), transform .1s, box-shadow var(--trans), color var(--trans);
    text-decoration: none;
    line-height: 1.2;
    white-space: nowrap;
}
.emr-btn--dark  { background: var(--c-dark); color: var(--c-white); }
.emr-btn--dark:hover  { background: #1a3a58; box-shadow: 0 4px 14px rgba(13,33,54,.25); }
.emr-btn--ghost { background: transparent; color: var(--c-text); border: 1.5px solid var(--c-border); }
.emr-btn--ghost:hover { background: var(--c-bg); border-color: #94a3b8; }
.emr-btn--outline { background: transparent; color: var(--c-blue); border: 1.5px solid var(--c-blue); }
.emr-btn--outline:hover { background: var(--c-blue); color: var(--c-white); }
.emr-btn--full  { width: 100%; }
.emr-btn--sm    { padding: 6px 14px; font-size: 12px; }
.emr-btn:active { transform: scale(.97); }
.emr-btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ── Messages ─────────────────────────────────────────────────── */
.emr-message {
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    margin: 0 28px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: emr-fade .2s ease;
}
.emr-message--success { background: #d1fae5; color: #065f46; border-left: 4px solid var(--c-green); }
.emr-message--error   { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--c-red); }
.emr-field-error { font-size: 11.5px; color: var(--c-red); margin-top: 3px; }

/* ── Hint ─────────────────────────────────────────────────────── */
.emr-hint { font-size: 12px; color: var(--c-muted); margin-top: 8px; }

/* ── Login Page ───────────────────────────────────────────────── */
.emr-login-wrap { max-width: 460px; }
.emr-login-panel { padding: 32px 32px 24px; }
.emr-login-sub   { font-size: 14px; color: var(--c-muted); margin-bottom: 22px; margin-top: -12px; }

.emr-login-extras {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
}
.emr-remember { display: flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; }
.emr-remember input { accent-color: var(--c-dark); width: 15px; height: 15px; cursor: pointer; }

.emr-link-btn { background: none; border: none; color: var(--c-blue); font-size: 13px; cursor: pointer; font-family: inherit; padding: 0; font-weight: 500; }
.emr-link-btn:hover { text-decoration: underline; }
.emr-back-btn { display: block; margin-bottom: 14px; font-size: 12px; }

.emr-login-actions { margin-top: 18px; }
.emr-login-register { text-align: center; font-size: 13px; color: var(--c-muted); margin-top: 18px; }
.emr-login-register a { color: var(--c-blue); font-weight: 600; text-decoration: none; }
.emr-login-register a:hover { text-decoration: underline; }

/* ── Profile Security Cards ───────────────────────────────────── */
.emr-security-card {
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 18px;
}
.emr-security-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 14px; color: var(--c-dark); }
.emr-danger-zone { border-color: #fecaca; background: #fff5f5; }
.emr-danger-zone h3 { color: var(--c-red); }

/* ═══════════════════════════════════════════════════════════════════
   DASHBOARD
═══════════════════════════════════════════════════════════════════ */
.emr-dash {
    display: flex;
    gap: 22px;
    align-items: flex-start;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0;
}

/* Sticky sidebar */
.emr-dash__sidebar {
    width: 248px;
    flex-shrink: 0;
    position: sticky;
    top: 72px;
    align-self: flex-start;
}

/* Scrollable main */
.emr-dash__main { flex: 1; min-width: 0; }

/* Profile Card */
.emr-profile-card {
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 26px 20px 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
}
.emr-profile-card__avatar {
    width: 54px; height: 54px;
    background: var(--c-dark);
    color: var(--c-white);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 800;
    margin-bottom: 2px;
    flex-shrink: 0;
    overflow: hidden;
}
.emr-profile-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.emr-profile-card__name { font-size: 17px; font-weight: 800; color: var(--c-text); letter-spacing: -.2px; }
.emr-profile-card__meta { font-size: 12px; color: var(--c-muted); line-height: 1.5; }

.emr-profile-card__bar-wrap { width: 100%; }
.emr-profile-card__bar { height: 5px; background: var(--c-border); border-radius: 3px; overflow: hidden; }
.emr-profile-card__bar-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--c-dark) 0%, #c0392b 100%); transition: width .7s ease; }
.emr-profile-card__completion { font-size: 11.5px; color: var(--c-muted); font-weight: 500; }

/* Dashboard Cards */
.emr-dash-card {
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
}
.emr-dash-card + .emr-dash-card { margin-top: 0; }
.emr-dash-card__title { font-size: 15px; font-weight: 700; color: var(--c-text); margin-bottom: 14px; }
.emr-dash-card__empty { font-size: 13px; color: var(--c-muted); }

/* Score Card */
.emr-dash-card--score { text-align: center; padding: 28px 24px 22px; margin-bottom: 20px; }
.emr-score-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--c-muted); display: block; margin-bottom: 4px; }
.emr-score-value { font-size: 48px; font-weight: 800; color: var(--c-text); line-height: 1; letter-spacing: -2px; }
.emr-score-tag { font-size: 14px; color: var(--c-muted); margin: 6px 0 18px; font-weight: 500; }
.emr-score-bar-wrap { max-width: 380px; margin: 0 auto; }
.emr-score-bar { height: 8px; background: var(--c-border); border-radius: 4px; overflow: hidden; }
.emr-score-bar__fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--c-dark) 0%, #c0392b 100%); transition: width .8s ease; }

/* Dashboard Grid */
.emr-dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.emr-dash-card--full { grid-column: 1 / -1; }

/* Missing Docs */
.emr-doc-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.emr-doc-list li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.emr-doc-list__icon { width: 20px; height: 20px; background: #fee2e2; color: var(--c-red); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; flex-shrink: 0; }

/* Required Tools */
.emr-tools-list { list-style: none; }
.emr-tools-list li { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--c-border); font-size: 13.5px; }
.emr-tools-list li:last-child { border-bottom: none; }
.emr-tools-list__name { font-weight: 500; }
.emr-tools-list__level { font-size: 12.5px; font-weight: 600; }
.emr-tools-list__level--basic        { color: var(--c-blue); }
.emr-tools-list__level--intermediate { color: var(--c-amber); }
.emr-tools-list__level--advanced     { color: var(--c-green); }
.emr-tools-list__level--not-started  { color: var(--c-muted); }

/* Courses */
.emr-courses-list { list-style: none; }
.emr-courses-list li { padding: 9px 0; border-bottom: 1px solid var(--c-border); }
.emr-courses-list li:last-child { border-bottom: none; }
.emr-courses-list__title { display: block; font-size: 14px; font-weight: 600; color: var(--c-text); margin-bottom: 2px; }
.emr-courses-list__meta  { font-size: 12px; color: var(--c-muted); }

/* Opportunities */
.emr-opp-list { list-style: none; }
.emr-opp-list li { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--c-border); gap: 12px; }
.emr-opp-list li:last-child { border-bottom: none; }
.emr-opp-list__title { display: block; font-size: 14px; font-weight: 600; color: var(--c-text); margin-bottom: 1px; }
.emr-opp-list__meta  { font-size: 12px; color: var(--c-blue); font-weight: 500; }

/* Logout link in dashboard */
.emr-dash-logout { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--c-muted); background: none; border: none; cursor: pointer; font-family: inherit; padding: 0; margin-top: 6px; }
.emr-dash-logout:hover { color: var(--c-red); }

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .emr-dash { flex-direction: column; }
    .emr-dash__sidebar { width: 100%; position: static; }
    .emr-profile-card { flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
    .emr-profile-card__bar-wrap { width: 100%; }
    .emr-dash-grid { grid-template-columns: 1fr; }
    .emr-dash-card--full { grid-column: 1; }
}
@media (max-width: 680px) {
    .emr-fields--cards { grid-template-columns: 1fr 1fr; }
    .emr-fields--grid  { grid-template-columns: 1fr; }
    .emr-field--half   { grid-column: 1 / -1; }
    .emr-wrap .emr-steps { padding: 20px 16px 0; }
    .emr-tabs { padding: 12px 16px 10px; gap: 4px; }
    .emr-tab  { font-size: 11px; padding: 5px 10px; }
    .emr-nav  { padding: 16px 0 20px; }
    .emr-step__title { font-size: 18px; }
    .emr-doc-upload-grid { grid-template-columns: 1fr; }
    .emr-login-panel { padding: 24px 20px 18px; }
}
@media (max-width: 420px) {
    .emr-fields--cards { grid-template-columns: 1fr; }
    .emr-login-extras { flex-direction: column !important; align-items: flex-start !important; gap: 8px; }
}
