:root {
    --auth-blue: #2563eb;
    --auth-blue-hover: #1d4ed8;
    --auth-blue-light: #e8effc;
    --auth-heading-color: #1e3a8a;
    --auth-text: #1e293b;
    --auth-muted: #64748b;
    --auth-border: #ced4da;
    --auth-panel-bg: #ffffff;
}

* { box-sizing: border-box; }

body.auth-page {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--auth-text);
    background: var(--auth-panel-bg);
}

.auth-shell {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.auth-panel-left {
    flex: 0 0 42%;
    width: 42%;
    max-width: 560px;
    min-width: 300px;
    min-height: 100vh;
    background: var(--auth-panel-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 3rem;
    overflow-y: auto;
}

.auth-panel-inner {
    width: 100%;
    max-width: 380px;
}

.auth-panel-right {
    flex: 1;
    display: none;
    min-height: 100vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

@media (min-width: 992px) {
    .auth-panel-right { display: block; }
}

@media (max-width: 991px) {
    .auth-panel-left {
        flex: 1;
        width: 100%;
        max-width: none;
    }
}

.auth-login-header {
    text-align: center;
    margin-bottom: 2.25rem;
    padding-bottom: 0.25rem;
}

.auth-emblem-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 140px;
    height: 140px;
    margin: 0 auto 1.75rem;
    padding: 0.75rem;
    border-radius: 50%;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06), 0 0 0 1px rgba(15, 23, 42, 0.04);
}

.auth-emblem {
    width: 112px;
    height: 112px;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.auth-heading {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 0.6rem;
    color: var(--auth-heading-color);
    text-align: center;
}

.auth-subheading {
    font-size: 0.9375rem;
    color: var(--auth-muted);
    margin: 0 auto;
    max-width: 320px;
    line-height: 1.55;
    text-align: center;
}

.auth-field {
    margin-bottom: 1.25rem;
}

.auth-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--auth-text);
    margin-bottom: 0.4rem;
}

.auth-hint {
    font-size: 0.8rem;
    color: var(--auth-muted);
    margin: 0.5rem 0 0;
}

.phone-input-group {
    display: flex;
    align-items: center;
    border: 1px solid var(--auth-border);
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.phone-input-group:focus-within {
    border-color: var(--auth-blue);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.phone-input-group.is-invalid {
    border-color: #dc3545;
}

.phone-prefix {
    padding: 0.65rem 0 0.65rem 0.85rem;
    color: var(--auth-muted);
    font-size: 0.95rem;
    white-space: nowrap;
}

.phone-input-group input {
    flex: 1;
    border: 0;
    outline: 0;
    padding: 0.65rem 0.5rem;
    font-size: 1rem;
    min-width: 0;
}

.phone-flag {
    padding: 0 0.75rem 0 0.35rem;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.phone-flag-icon {
    display: block;
    width: 26px;
    height: auto;
    border-radius: 2px;
}

.auth-btn {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 4px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.auth-btn-primary {
    background: var(--auth-blue);
    color: #fff;
    margin-top: 0.5rem;
}

.auth-btn-primary:hover:not(:disabled) {
    background: var(--auth-blue-hover);
}

.auth-btn-secondary {
    background: var(--auth-blue-light);
    color: var(--auth-blue);
    margin-top: 1rem;
}

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

.auth-link {
    color: var(--auth-blue);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.auth-link:hover { text-decoration: underline; }

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
}

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

.pin-boxes {
    display: flex;
    justify-content: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
}

.pin-box {
    width: 44px;
    height: 44px;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 600;
    border: 1px solid var(--auth-border);
    border-radius: 4px;
    outline: 0;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.pin-box:focus {
    border-color: var(--auth-blue);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.pin-boxes.is-invalid .pin-box { border-color: #dc3545; }

.pin-step-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--auth-blue-light);
    color: var(--auth-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 1rem;
    font-size: 1.25rem;
}

.pin-step-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0 0 0.35rem;
    color: var(--auth-heading-color);
}

.pin-step-sub {
    font-size: 0.9rem;
    color: var(--auth-muted);
    margin: 0 0 1.25rem;
    line-height: 1.45;
}

.invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 0.35rem;
}

.auth-alert {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

.auth-alert-info {
    background: #dbeafe;
    color: #1e40af;
}

.auth-footer-links {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: 1rem;
}

/* COP SSO loading overlay — hidden by default (no Bootstrap on auth pages) */
.sso-loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.92);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
}

.sso-loading-overlay.is-active {
    display: flex;
}

.sso-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: sso-spin 0.8s linear infinite;
}

.sso-loading-text {
    margin: 0;
    color: #1e3a5f;
    font-weight: 600;
}

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