/* =========================================================
   BAMIDO - Authentication Styles
   FE-05
   ========================================================= */

:root {
    --auth-max-width: 480px;
    --auth-radius: 20px;
    --auth-input-height: 52px;
}

/* ---------------------------------------------------------
   Authentication Page
   --------------------------------------------------------- */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.auth-container {
    width: 100%;
    max-width: var(--auth-max-width);
    margin: 0 auto;
}

.auth-card {
    width: 100%;
    background: var(--bm-surface, #ffffff);
    border-radius: var(--auth-radius);
    padding: 34px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--bm-border, #e5e7eb);
}

/* ---------------------------------------------------------
   Header
   --------------------------------------------------------- */

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.auth-logo img {
    max-width: 150px;
    max-height: 60px;
    object-fit: contain;
}

.auth-title {
    margin: 0 0 8px;
    font-size: 1.55rem;
    font-weight: 800;
}

.auth-subtitle {
    margin: 0;
    line-height: 1.8;
    color: var(--bm-text-muted, #6b7280);
}

/* ---------------------------------------------------------
   Forms
   --------------------------------------------------------- */

.auth-form {
    width: 100%;
}

.auth-field {
    margin-bottom: 18px;
}

.auth-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

.auth-required {
    color: var(--bm-danger, #dc2626);
}

.auth-input-wrapper {
    position: relative;
}

.auth-input {
    width: 100%;
    height: var(--auth-input-height);
    padding: 0 15px;
    border: 1px solid var(--bm-border, #d1d5db);
    border-radius: 12px;
    background: var(--bm-surface, #ffffff);
    color: var(--bm-text, #111827);
    font-family: inherit;
    font-size: 0.98rem;
    outline: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
    box-sizing: border-box;
}

.auth-input:focus {
    border-color: var(--bm-primary, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.auth-input.is-invalid {
    border-color: var(--bm-danger, #dc2626);
}

.auth-input.is-valid {
    border-color: var(--bm-success, #16a34a);
}

.auth-field-error {
    display: none;
    margin-top: 6px;
    font-size: 0.84rem;
    line-height: 1.6;
    color: var(--bm-danger, #dc2626);
}

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

/* ---------------------------------------------------------
   Password
   --------------------------------------------------------- */

.auth-password-toggle {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 6px;
    color: var(--bm-text-muted, #6b7280);
}

html[dir="ltr"] .auth-password-toggle {
    left: auto;
    right: 12px;
}

.auth-password-toggle:hover {
    color: var(--bm-primary, #2563eb);
}

/* ---------------------------------------------------------
   Checkboxes
   --------------------------------------------------------- */

.auth-check-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 16px 0;
    line-height: 1.7;
}

.auth-check-row input {
    margin-top: 5px;
    flex: 0 0 auto;
}

.auth-check-row label {
    font-weight: 400;
    margin: 0;
}

/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */

.auth-submit {
    width: 100%;
    min-height: 52px;
    margin-top: 8px;
}

.auth-submit.is-loading {
    pointer-events: none;
    opacity: 0.7;
}

/* ---------------------------------------------------------
   Links
   --------------------------------------------------------- */

.auth-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.auth-link {
    color: var(--bm-primary, #2563eb);
    text-decoration: none;
    font-weight: 700;
}

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

/* ---------------------------------------------------------
   Alerts
   --------------------------------------------------------- */

.auth-alert {
    display: none;
    margin-bottom: 20px;
    padding: 13px 15px;
    border-radius: 12px;
    line-height: 1.8;
    font-size: 0.9rem;
}

.auth-alert.is-visible {
    display: block;
}

.auth-alert--error {
    background: rgba(220, 38, 38, 0.08);
    color: #b91c1c;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.auth-alert--success {
    background: rgba(22, 163, 74, 0.08);
    color: #15803d;
    border: 1px solid rgba(22, 163, 74, 0.2);
}

.auth-alert--warning {
    background: rgba(217, 119, 6, 0.08);
    color: #b45309;
    border: 1px solid rgba(217, 119, 6, 0.2);
}

/* ---------------------------------------------------------
   Registration Type
   --------------------------------------------------------- */

.auth-role-selection {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 22px;
}

.auth-role-option {
    position: relative;
}

.auth-role-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.auth-role-card {
    display: block;
    padding: 17px 14px;
    border: 1px solid var(--bm-border, #d1d5db);
    border-radius: 14px;
    cursor: pointer;
    text-align: center;
    transition: 0.2s ease;
}

.auth-role-card strong {
    display: block;
    margin-bottom: 5px;
}

.auth-role-card span {
    display: block;
    font-size: 0.82rem;
    color: var(--bm-text-muted, #6b7280);
    line-height: 1.6;
}

.auth-role-option input:checked + .auth-role-card {
    border-color: var(--bm-primary, #2563eb);
    background: rgba(37, 99, 235, 0.06);
}

/* ---------------------------------------------------------
   Verification
   --------------------------------------------------------- */

.auth-code {
    direction: ltr;
    text-align: center;
    letter-spacing: 0.35em;
    font-size: 1.45rem;
    font-weight: 800;
}

.auth-code-help {
    margin-top: 8px;
    color: var(--bm-text-muted, #6b7280);
    font-size: 0.85rem;
    line-height: 1.8;
}

.auth-resend {
    margin-top: 15px;
    text-align: center;
}

.auth-resend button {
    border: 0;
    background: transparent;
    color: var(--bm-primary, #2563eb);
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
}

.auth-resend button:disabled {
    color: var(--bm-text-muted, #9ca3af);
    cursor: not-allowed;
}

/* ---------------------------------------------------------
   Admin
   --------------------------------------------------------- */

.auth-admin-card {
    border-top: 4px solid var(--bm-primary, #2563eb);
}

.auth-admin-notice {
    margin-bottom: 20px;
    padding: 13px 15px;
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.07);
    line-height: 1.8;
    font-size: 0.88rem;
}

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

@media (max-width: 600px) {

    .auth-page {
        padding: 18px 12px;
        align-items: flex-start;
    }

    .auth-card {
        margin-top: 12px;
        padding: 24px 18px;
        border-radius: 16px;
    }

    .auth-role-selection {
        grid-template-columns: 1fr;
    }

    .auth-links {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
}

@media (max-width: 380px) {

    .auth-card {
        padding: 20px 14px;
    }

    .auth-title {
        font-size: 1.35rem;
    }

    .auth-input {
        height: 49px;
    }
}