/* === AUTH SHELL === */

.auth-page {
    min-height: 100vh;
    background: var(--ob2);
    display: flex;
    flex-direction: column;
}

.auth-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-nav);
    height: 52px;
    background: var(--ob2);
    border-bottom: 0.5px solid var(--ob4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--cpad-m);
}

@media (min-width: 768px) {
    .auth-topbar {
        padding: 0 var(--cpad-d);
    }
}

.auth-logo {
    font-family: var(--fs);
    font-size: 18px;
    letter-spacing: -0.4px;
    color: #F0EDE6;
    text-decoration: none;
}

.auth-logo em {
    font-style: italic;
    color: var(--v);
}

.auth-topbar-hint {
    font-size: var(--t-sm);
    color: #6A6660;
}

.auth-topbar-hint a {
    color: #C8C4BC;
    text-decoration: none;
    font-weight: 500;
    transition: color var(--ease);
}

.auth-topbar-hint a:hover {
    color: #F0EDE6;
}


/* === MAIN LAYOUT === */

.auth-main {
    flex: 1;
    padding-top: 52px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-bottom: var(--sp16);
}

.auth-panel {
    width: 100%;
    max-width: 480px;
    padding: var(--sp10) var(--cpad-m) 0;
}

@media (min-width: 540px) {
    .auth-panel {
        padding: var(--sp10) 0 0;
    }
}


/* === ROLE SELECTOR (signup only) === */

.auth-role-step {
    text-align: center;
    padding-top: var(--sp6);
}

.auth-eyebrow {
    font-size: 9px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 600;
    color: #5A5650;
    margin-bottom: var(--sp3);
}

.auth-heading {
    font-family: var(--fs);
    font-size: clamp(22px, 3vw, 30px);
    color: #F0EDE6;
    letter-spacing: -0.5px;
    line-height: 1.2;
    margin-bottom: var(--sp2);
}

.auth-sub {
    font-size: var(--t-sm);
    color: #6A6660;
    line-height: 1.7;
    margin-bottom: var(--sp8);
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

.role-grid {
    display: flex;
    flex-direction: column;
    gap: var(--sp3);
    margin-bottom: var(--sp6);
}

.role-option {
    background: var(--ob3);
    border: 0.5px solid var(--ob4);
    border-radius: var(--r-xl);
    padding: var(--sp5);
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: var(--sp4);
    transition: border-color var(--ease), background var(--ease);
    width: 100%;
    font-family: var(--fn);
    position: relative;
}

.role-option:hover {
    border-color: var(--ob5);
    background: var(--ob4);
}

.role-option.selected {
    border-color: var(--v);
    background: var(--ob3);
}

.role-option.selected::after {
    content: '';
    position: absolute;
    top: 14px;
    right: 16px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--v);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='20 6 9 17 4 12' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: 10px;
    background-repeat: no-repeat;
    background-position: center;
}

.role-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--r-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.role-icon-issuer {
    background: rgba(139, 37, 0, 0.15);
}

.role-icon-holder {
    background: rgba(30, 77, 56, 0.2);
}

.role-icon-verifier {
    background: rgba(46, 44, 40, 0.6);
}

.role-label {
    font-size: 14px;
    font-weight: 500;
    color: #F0EDE6;
    margin-bottom: 3px;
}

.role-desc {
    font-size: var(--t-sm);
    color: #6A6660;
    line-height: 1.5;
}

.role-tag-pill {
    position: absolute;
    top: 14px;
    right: 16px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(217, 64, 16, 0.15);
    color: var(--v-d);
    border: 0.5px solid rgba(217, 64, 16, 0.25);
}

.auth-step-btn {
    width: 100%;
    min-height: var(--touch);
    background: var(--v);
    color: var(--v-p);
    border: none;
    border-radius: var(--r-md);
    font-family: var(--fn);
    font-size: var(--t-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--ease), opacity var(--ease);
    letter-spacing: 0.2px;
}

.auth-step-btn:hover:not(:disabled) {
    background: var(--v-h);
}

.auth-step-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}


/* === FORM STEP === */

.auth-form-step {
    display: none;
}

.auth-form-step.active {
    display: block;
}

.auth-form-header {
    margin-bottom: var(--sp6);
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: var(--sp2);
    font-size: var(--t-sm);
    color: #5A5650;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--fn);
    padding: 0;
    margin-bottom: var(--sp5);
    transition: color var(--ease);
}

.auth-back:hover {
    color: #C8C4BC;
}

.auth-form-card {
    background: var(--ob3);
    border: 0.5px solid var(--ob4);
    border-radius: var(--r-xl);
    overflow: hidden;
}

.auth-form-card-header {
    padding: var(--sp5) var(--sp6);
    border-bottom: 0.5px solid var(--ob4);
    display: flex;
    align-items: center;
    gap: var(--sp3);
}

.auth-form-card-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-form-card-title {
    font-size: var(--t-sm);
    font-weight: 600;
    color: #F0EDE6;
}

.auth-form-card-role {
    font-size: var(--t-xs);
    color: #5A5650;
    margin-top: 2px;
}

.auth-form-body {
    padding: var(--sp6);
    display: flex;
    flex-direction: column;
    gap: var(--sp4);
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: var(--sp1);
}

.auth-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp3);
}

@media (max-width: 400px) {
    .auth-field-row {
        grid-template-columns: 1fr;
    }
}

.auth-label {
    font-size: var(--t-xs);
    font-weight: 600;
    color: #6A6660;
    letter-spacing: 0.3px;
}

.auth-input {
    width: 100%;
    min-height: var(--touch);
    padding: 0 14px;
    background: var(--ob2);
    border: 0.5px solid var(--ob4);
    border-radius: var(--r-md);
    font-family: var(--fn);
    font-size: var(--t-sm);
    color: #C8C4BC;
    outline: none;
    transition: border-color var(--ease);
    appearance: none;
    -webkit-appearance: none;
}

.auth-input:focus {
    border-color: var(--v);
}

.auth-input::placeholder {
    color: #3A3830;
}

.auth-input[aria-invalid="true"] {
    border-color: var(--rv-i);
}

.auth-select {
    width: 100%;
    min-height: var(--touch);
    padding: 0 14px;
    background: var(--ob2);
    border: 0.5px solid var(--ob4);
    border-radius: var(--r-md);
    font-family: var(--fn);
    font-size: var(--t-sm);
    color: #C8C4BC;
    outline: none;
    transition: border-color var(--ease);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9' fill='none' stroke='%236A6660' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
}

.auth-select:focus {
    border-color: var(--v);
}

.auth-field-hint {
    font-size: var(--t-xs);
    color: #4A4840;
    line-height: 1.5;
}

.auth-field-error {
    font-size: var(--t-xs);
    color: var(--rv-i);
    display: none;
}

.auth-field-error.visible {
    display: block;
}

.auth-password-wrap {
    position: relative;
}

.auth-password-wrap .auth-input {
    padding-right: 44px;
}

.auth-password-toggle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 44px;
    background: none;
    border: none;
    color: #5A5650;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--ease);
}

.auth-password-toggle:hover {
    color: #C8C4BC;
}


/* === PASSWORD STRENGTH === */

.pw-strength {
    margin-top: var(--sp2);
}

.pw-strength-bars {
    display: flex;
    gap: 3px;
    margin-bottom: var(--sp1);
}

.pw-bar {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: var(--ob4);
    transition: background 0.2s ease;
}

.pw-bar.weak {
    background: var(--rv-i);
}

.pw-bar.fair {
    background: var(--fr-i);
}

.pw-bar.good {
    background: #3A7A5A;
}

.pw-bar.strong {
    background: var(--ac-i);
}

.pw-strength-label {
    font-size: var(--t-xs);
    color: #4A4840;
    transition: color 0.2s ease;
}

.pw-strength-label.weak {
    color: var(--rv-i);
}

.pw-strength-label.fair {
    color: var(--fr-i);
}

.pw-strength-label.good {
    color: #3A7A5A;
}

.pw-strength-label.strong {
    color: var(--ac-i);
}

.pw-requirements {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: var(--sp2);
}

.pw-req {
    display: flex;
    align-items: center;
    gap: var(--sp2);
    font-size: var(--t-xs);
    color: #4A4840;
    transition: color 0.15s ease;
}

.pw-req.met {
    color: var(--ac-i);
}

.pw-req-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--ob4);
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.pw-req.met .pw-req-dot {
    background: var(--ac-i);
}


/* === PASSWORD MATCH === */

.pw-match {
    display: flex;
    align-items: center;
    gap: var(--sp2);
    font-size: var(--t-xs);
    margin-top: var(--sp2);
    min-height: 16px;
    color: transparent;
    transition: color 0.15s ease;
}

.pw-match-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: transparent;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.pw-match.match {
    color: var(--ac-i);
}

.pw-match.mismatch {
    color: var(--rv-i);
}

.pw-match.match .pw-match-dot {
    background: var(--ac-i);
}

.pw-match.mismatch .pw-match-dot {
    background: var(--rv-i);
}


.auth-divider {
    height: 0.5px;
    background: var(--ob4);
}

.auth-form-footer {
    padding: var(--sp5) var(--sp6);
    display: flex;
    flex-direction: column;
    gap: var(--sp3);
}

.auth-submit {
    width: 100%;
    min-height: var(--touch);
    background: var(--v);
    color: var(--v-p);
    border: none;
    border-radius: var(--r-md);
    font-family: var(--fn);
    font-size: var(--t-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--ease), opacity var(--ease);
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp2);
}

.auth-submit:hover:not(:disabled) {
    background: var(--v-h);
}

.auth-submit:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.auth-submit[data-loading="true"]::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 1.5px solid rgba(247, 237, 232, 0.4);
    border-top-color: var(--v-p);
    border-radius: 50%;
    animation: auth-spin 0.6s linear infinite;
}

@keyframes auth-spin {
    to {
        transform: rotate(360deg);
    }
}

.auth-terms {
    font-size: var(--t-xs);
    color: #4A4840;
    line-height: 1.6;
    text-align: center;
}

.auth-terms a {
    color: #6A6660;
    text-decoration: underline;
    text-decoration-color: #3A3830;
    transition: color var(--ease);
}

.auth-terms a:hover {
    color: #C8C4BC;
}


/* === ISSUER PENDING STATE === */

.auth-pending-card {
    background: var(--ob3);
    border: 0.5px solid var(--ob4);
    border-radius: var(--r-xl);
    padding: var(--sp8) var(--sp6);
    text-align: center;
    display: none;
}

.auth-pending-card.active {
    display: block;
}

.auth-pending-icon {
    width: 56px;
    height: 56px;
    background: rgba(92, 74, 0, 0.2);
    border: 0.5px solid var(--fr-b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--sp5);
}

.auth-pending-title {
    font-family: var(--fs);
    font-size: 22px;
    color: #F0EDE6;
    margin-bottom: var(--sp3);
}

.auth-pending-body {
    font-size: var(--t-sm);
    color: #6A6660;
    line-height: 1.75;
    max-width: 340px;
    margin: 0 auto var(--sp6);
}

.auth-pending-steps {
    display: flex;
    flex-direction: column;
    gap: var(--sp3);
    text-align: left;
    max-width: 340px;
    margin: 0 auto var(--sp6);
}

.auth-pending-step {
    display: flex;
    align-items: flex-start;
    gap: var(--sp3);
}

.auth-pending-step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--ob4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: #8A8480;
    flex-shrink: 0;
    margin-top: 1px;
}

.auth-pending-step-text {
    font-size: var(--t-sm);
    color: #6A6660;
    line-height: 1.6;
}


/* === SUCCESS STATE (holder/verifier) === */

.auth-success-card {
    background: var(--ob3);
    border: 0.5px solid var(--ac-b);
    border-radius: var(--r-xl);
    padding: var(--sp8) var(--sp6);
    text-align: center;
    display: none;
}

.auth-success-card.active {
    display: block;
}

.auth-success-icon {
    width: 56px;
    height: 56px;
    background: rgba(30, 77, 56, 0.2);
    border: 0.5px solid var(--ac-b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--sp5);
}

.auth-success-title {
    font-family: var(--fs);
    font-size: 22px;
    color: #F0EDE6;
    margin-bottom: var(--sp3);
}

.auth-success-body {
    font-size: var(--t-sm);
    color: #6A6660;
    line-height: 1.75;
    max-width: 320px;
    margin: 0 auto var(--sp6);
}


/* === SECURITY BADGES === */

.auth-trust-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp5);
    margin-top: var(--sp6);
    flex-wrap: wrap;
}

.auth-trust-item {
    display: flex;
    align-items: center;
    gap: var(--sp2);
    font-size: var(--t-xs);
    color: #3A3830;
}


/* === LOGIN PAGE EXTRAS === */

.auth-forgot {
    font-size: var(--t-xs);
    color: #4A4840;
    text-align: right;
    text-decoration: none;
    transition: color var(--ease);
}

.auth-forgot:hover {
    color: #8A8480;
}

.auth-or-divider {
    display: flex;
    align-items: center;
    gap: var(--sp3);
    margin: var(--sp1) 0;
}

.auth-or-line {
    flex: 1;
    height: 0.5px;
    background: var(--ob4);
}

.auth-or-text {
    font-size: var(--t-xs);
    color: #3A3830;
    flex-shrink: 0;
}