/* ==========================================================================
   SALAMA HOSTING — Admin Portal sign-in pages (login, password reset, OTP...)

   Loaded after salama-custom.css by common/authHead.php, so these pages use
   the portal's own tokens, type, buttons, inputs, checkboxes and alerts.
   This file only adds the two-pane layout and the auth-* pieces, built from
   the same tokens: the brand pane is the sidebar's dark slate, the card is a
   .stg-panel, inputs and buttons match .form-control and .btn.
   ========================================================================== */

.auth-body {
    min-height: 100vh;
    background: var(--body-bg);
}

.auth-wrapper {
    display: flex;
    min-height: 100vh;
}

/* --- Brand pane (desktop only) ------------------------------------------- */
.auth-brand-panel {
    position: relative;
    display: none;
    flex: 0 0 42%;
    max-width: 560px;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--space-10);
    padding: var(--space-10) var(--space-12);
    overflow: hidden;
    color: var(--sidebar-text);
    background: var(--sidebar-bg);
}

/* Faint grid fading out towards the bottom, and a soft brand glow */
.auth-brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 32px 32px;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 80%);
    mask-image: linear-gradient(to bottom, #000 0%, transparent 80%);
    pointer-events: none;
}

.auth-brand-panel::after {
    content: '';
    position: absolute;
    right: -180px;
    bottom: -200px;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.32) 0%, transparent 70%);
    pointer-events: none;
}

.auth-brand-logo,
.auth-brand-content,
.auth-brand-foot {
    position: relative;
    z-index: 1;
}

/* Same treatment as the sidebar: the blue logo rendered white on the dark rail */
.auth-brand-logo img {
    width: auto;
    max-width: 160px;
    max-height: 34px;
    filter: brightness(0) invert(1);
}

.auth-brand-content {
    max-width: 400px;
}

.auth-brand-eyebrow {
    display: inline-block;
    margin-bottom: var(--space-4);
    padding: 3px 10px;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--sidebar-accent);
    background: var(--sidebar-active-bg);
    border-radius: var(--radius-pill);
}

.auth-brand-content h2 {
    margin: 0 0 var(--space-3);
    font-size: 28px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: #fff;
}

.auth-brand-content p {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--sidebar-muted);
}

.auth-brand-features {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin: var(--space-8) 0 0;
    padding: 0;
    list-style: none;
}

.auth-brand-features li {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--fs-md);
    color: var(--sidebar-text);
}

.auth-brand-features i {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    font-size: 13px;
    color: var(--sidebar-accent);
    background: var(--sidebar-hover);
    border: 1px solid var(--sidebar-border);
    border-radius: var(--radius-md);
}

.auth-brand-foot {
    font-size: var(--fs-sm);
    color: var(--sidebar-label);
}

/* --- Form pane ----------------------------------------------------------- */
.auth-form-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: var(--space-10) var(--space-6);
    overflow-y: auto;
}

.auth-form-container {
    width: 100%;
    max-width: 420px;
}

.auth-form-container.auth-wide {
    max-width: 680px;
}

.auth-logo-mobile {
    margin-bottom: var(--space-6);
    text-align: center;
}

.auth-logo-mobile img {
    width: 140px;
}

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

    .auth-logo-mobile {
        display: none;
    }
}

/* The card is a .stg-panel */
.auth-card {
    padding: var(--space-8);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.auth-card-header {
    margin-bottom: var(--space-6);
}

.auth-card-header h3 {
    margin: 0 0 6px;
    font-size: var(--fs-2xl);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.auth-card-header p {
    margin: 0;
    font-size: var(--fs-md);
    line-height: 1.5;
    color: var(--text-muted);
}

/* --- Form controls: the portal's .form-control and .btn ------------------ */
.auth-form-group {
    margin-bottom: var(--space-4);
}

/* "label." raises these above AdminLTE's bold label:not(...) rule */
label.auth-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.auth-label .req {
    color: var(--danger);
}

.auth-input,
.auth-select {
    display: block;
    width: 100%;
    min-height: 40px;
    padding: 9px 12px;
    font-family: var(--font-family);
    font-size: var(--fs-md);
    line-height: 1.4;
    color: var(--text-primary);
    background-color: var(--card-bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--input-radius);
    outline: none;
    transition: var(--transition);
}

.auth-input::placeholder {
    color: var(--text-light);
}

.auth-input:focus,
.auth-select:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-focus);
}

.auth-select {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 36px;
    background: var(--card-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center / 12px 12px;
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    width: 100%;
    min-height: 40px;
    padding: 9px 16px;
    font-family: var(--font-family);
    font-size: var(--fs-md);
    font-weight: 500;
    line-height: 1.25;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--btn-radius);
    cursor: pointer;
    transition: var(--transition);
}

.auth-btn:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
}

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

.auth-btn-primary {
    color: var(--text-inverse);
    background: var(--primary);
    border-color: var(--primary);
}

.auth-btn-primary:hover:not(:disabled) {
    color: var(--text-inverse);
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Quiet bordered button, like .btn-outline-secondary */
.auth-btn-secondary {
    width: auto;
    color: var(--text-secondary);
    background: var(--card-bg);
    border-color: var(--border-strong);
}

.auth-btn-secondary:hover {
    color: var(--text-primary);
    background: var(--table-header-bg);
    border-color: var(--text-light);
}

.auth-btn-sm {
    min-height: 32px;
    padding: 5px 10px;
    font-size: var(--fs-sm);
}

.auth-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.auth-row {
    display: flex;
    gap: var(--space-4);
}

.auth-row > * {
    flex: 1;
    min-width: 0;
}

.auth-checkbox-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.auth-checkbox-row label:not(.auth-label) {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    font-size: var(--fs-md);
    font-weight: 400;
    color: var(--text-secondary);
    cursor: pointer;
}

.auth-checkbox-row a,
.auth-footer a {
    font-weight: 500;
    text-decoration: none;
}

.auth-checkbox-row a:hover,
.auth-footer a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-divider {
    margin: var(--space-6) 0;
    border: 0;
    border-top: 1px solid var(--border-light);
}

.auth-footer {
    text-align: center;
    font-size: var(--fs-md);
    color: var(--text-muted);
}

/* --- Messages ------------------------------------------------------------ */
/* Server feedback arrives as a portal .alert inside .auth-alert */
.auth-alert {
    margin-bottom: var(--space-5);
}

.auth-alert > .alert:last-child {
    margin-bottom: 0;
}

.auth-alert-success,
.auth-alert-danger,
.auth-alert-warning {
    padding: 12px 14px;
    font-size: var(--fs-md);
    line-height: 1.5;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
}

.auth-alert-success { color: var(--success-fg); background: var(--success-bg); border-color: var(--success-border); }
.auth-alert-danger  { color: var(--danger-fg);  background: var(--danger-bg);  border-color: var(--danger-border); }
.auth-alert-warning { color: var(--warning-fg); background: var(--warning-bg); border-color: var(--warning-border); }

.auth-copyright {
    margin-top: var(--space-8);
    text-align: center;
    font-size: var(--fs-sm);
    color: var(--text-light);
}

/* --- Status pages (account locked, invalid link, email confirmed) -------- */
.auth-status {
    text-align: center;
}

.auth-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: var(--space-4);
    font-size: 22px;
    color: var(--primary);
    background: var(--primary-subtle);
    border-radius: 50%;
}

.auth-status-icon.success { color: var(--success); background: var(--success-bg); }
.auth-status-icon.danger  { color: var(--danger);  background: var(--danger-bg); }

.auth-text {
    margin: 0 0 var(--space-3);
    font-size: var(--fs-md);
    line-height: 1.6;
    color: var(--text-secondary);
}

.auth-text-muted {
    color: var(--text-muted);
}

.auth-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-5);
}

.auth-actions .auth-btn {
    width: auto;
}

/* --- One-time code boxes (built by views/settings/otp.php) --------------- */
.auth-otp {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
}

.auth-otp-digit {
    width: 46px;
    height: 52px;
    padding: 0;
    font-family: var(--font-family);
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    color: var(--text-primary);
    background: var(--card-bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--input-radius);
    outline: none;
    caret-color: var(--primary);
    transition: var(--transition);
    font-variant-numeric: tabular-nums;
}

.auth-otp-digit:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-focus);
}

/* --- Password requirements (register page) ------------------------------- */
.password-requirements {
    margin-top: var(--space-2);
    padding: 10px 12px;
    background: var(--table-header-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.password-requirements p {
    margin: 0 0 6px;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-secondary);
}

.password-requirements ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.password-requirements li {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
    font-size: var(--fs-sm);
    color: var(--text-muted);
}

.password-requirements li::before {
    content: '\f111';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 5px;
}

.password-requirements li.met {
    color: var(--success);
}

.password-requirements li.met::before {
    content: '\f058';
    font-size: 12px;
}

/* --- Small screens ------------------------------------------------------- */
@media (max-width: 575.98px) {
    .auth-form-panel {
        justify-content: flex-start;
        padding: var(--space-8) var(--space-4);
    }

    .auth-card {
        padding: var(--space-6) var(--space-5);
    }

    .auth-row {
        flex-direction: column;
        gap: 0;
    }

    .auth-otp-digit {
        width: 40px;
        height: 48px;
    }
}
