/* ==========================================================================
   HIREPAY AUTH — Modern SaaS login/2FA theme.
   Framework-free CSS, self-contained (no Tailwind, no dependency on
   central.css tokens). Used by layouts/guest.blade.php and its children.
   ========================================================================== */

:root {
    --auth-primary: #4f46e5;
    --auth-primary-hover: #4338ca;
    --auth-primary-light: #eef2ff;

    --auth-bg: #f8fafc;
    --auth-surface: #ffffff;
    --auth-border: #e2e8f0;
    --auth-border-focus: #4f46e5;

    --auth-text: #0f172a;
    --auth-text-secondary: #64748b;
    --auth-text-muted: #94a3b8;

    --auth-danger: #dc2626;
    --auth-danger-bg: #fef2f2;
    --auth-success: #16a34a;
    --auth-success-bg: #f0fdf4;

    --auth-radius-sm: 8px;
    --auth-radius-md: 12px;
    --auth-radius-lg: 20px;

    --auth-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --auth-shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
    --auth-shadow-lg: 0 24px 48px -12px rgba(15, 23, 42, 0.18);

    --auth-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --auth-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
}

body.auth-body {
    margin: 0;
    padding: 0;
    font-family: var(--auth-font);
    background: var(--auth-bg);
    color: var(--auth-text);
    min-height: 100vh;
}

/* Layout shell: centered card on a soft brand backdrop, with a promo panel
   on wider screens. */
.auth-shell {
    display: flex;
    min-height: 100vh;
}

.auth-brand-panel {
    flex: 1.1;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem;
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 55%, #3730a3 100%);
    color: #ffffff;
    overflow: hidden;
}

.auth-brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.12) 0, transparent 45%),
                       radial-gradient(circle at 80% 75%, rgba(255, 255, 255, 0.10) 0, transparent 40%);
    pointer-events: none;
}

.auth-brand-logo {
    position: relative;
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-decoration: none;
    color: #ffffff;
}

.auth-brand-content {
    position: relative;
    max-width: 420px;
}

.auth-brand-content h2 {
    font-size: 2rem;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 1rem 0;
}

.auth-brand-content p {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.82);
    margin: 0;
}

.auth-brand-footer {
    position: relative;
    display: flex;
    gap: 1.5rem;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.65);
}

.auth-brand-footer a {
    color: inherit;
    text-decoration: none;
}

.auth-brand-footer a:hover {
    color: #ffffff;
}

.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--auth-bg);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-lg);
    box-shadow: var(--auth-shadow-lg);
    padding: 2.5rem;
}

.auth-card-mobile-logo {
    display: none;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--auth-primary);
    text-decoration: none;
    margin-bottom: 1.5rem;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--auth-text);
    margin: 0 0 0.375rem 0;
}

.auth-subtitle {
    font-size: 0.9375rem;
    color: var(--auth-text-secondary);
    margin: 0 0 2rem 0;
    line-height: 1.5;
}

/* Messages */
.auth-alert {
    display: flex;
    gap: 0.625rem;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    border-radius: var(--auth-radius-sm);
    font-size: 0.8125rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.auth-alert-error {
    background: var(--auth-danger-bg);
    color: var(--auth-danger);
    border: 1px solid rgba(220, 38, 38, 0.15);
}

.auth-alert-success {
    background: var(--auth-success-bg);
    color: var(--auth-success);
    border: 1px solid rgba(22, 163, 74, 0.15);
}

/* Form elements */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--auth-text);
    margin-bottom: 0.4375rem;
}

.form-input {
    width: 100%;
    padding: 0.6875rem 0.875rem;
    border: 1.5px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--auth-text);
    background: var(--auth-surface);
    transition: var(--auth-transition);
}

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

.form-input:focus {
    outline: none;
    border-color: var(--auth-border-focus);
    box-shadow: 0 0 0 3px var(--auth-primary-light);
}

.form-input.error {
    border-color: var(--auth-danger);
}

.form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.field-error {
    display: block;
    color: var(--auth-danger);
    font-size: 0.8125rem;
    margin-top: 0.4375rem;
    font-weight: 500;
}

.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--auth-text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    line-height: 0;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: var(--auth-text-secondary);
}

.password-toggle svg.password-hidden {
    opacity: 0.6;
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--auth-primary);
    cursor: pointer;
}

.checkbox-label {
    font-size: 0.8125rem;
    color: var(--auth-text-secondary);
    user-select: none;
}

.trust-device-option {
    margin-bottom: 1.25rem;
}

.forgot-link,
.switch-link,
.cancel-link {
    color: var(--auth-primary);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: color 0.2s ease;
}

.forgot-link:hover,
.switch-link:hover,
.cancel-link:hover {
    color: var(--auth-primary-hover);
    text-decoration: underline;
}

/* Submit button */
.submit-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--auth-primary);
    color: #ffffff;
    border: none;
    border-radius: var(--auth-radius-sm);
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--auth-transition);
    position: relative;
}

.submit-btn:hover {
    background: var(--auth-primary-hover);
    box-shadow: var(--auth-shadow-md);
}

.submit-btn:active {
    transform: translateY(1px);
}

.submit-btn .btn-icon {
    transition: transform 0.2s ease;
}

.submit-btn:hover .btn-icon {
    transform: translateX(2px);
}

.submit-btn.loading {
    pointer-events: none;
    opacity: 0.85;
}

.submit-btn.loading .btn-text,
.submit-btn.loading .btn-icon {
    opacity: 0;
}

.submit-btn.loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: authSpin 0.7s linear infinite;
}

@keyframes authSpin {
    to { transform: rotate(360deg); }
}

/* Auth switch footer */
.auth-switch {
    text-align: center;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--auth-border);
}

.switch-text {
    color: var(--auth-text-secondary);
    font-size: 0.8125rem;
}

/* One-time code input group (2FA challenge) */
.otp-hint {
    font-size: 0.8125rem;
    color: var(--auth-text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.otp-hint strong {
    color: var(--auth-text);
}

.otp-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.5em;
    text-align: center;
    font-family: inherit;
    color: var(--auth-text);
    background: var(--auth-surface);
    transition: var(--auth-transition);
}

.otp-input:focus {
    outline: none;
    border-color: var(--auth-border-focus);
    box-shadow: 0 0 0 3px var(--auth-primary-light);
}

.otp-input.error {
    border-color: var(--auth-danger);
}

.otp-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.25rem;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.resend-form {
    display: inline;
}

.resend-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--auth-primary);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.resend-btn:hover {
    color: var(--auth-primary-hover);
    text-decoration: underline;
}

.resend-btn:disabled {
    color: var(--auth-text-muted);
    cursor: not-allowed;
    text-decoration: none;
}

/* Responsive */
@media (max-width: 900px) {
    .auth-brand-panel {
        display: none;
    }

    .auth-card-mobile-logo {
        display: inline-flex;
    }
}

@media (max-width: 480px) {
    .auth-form-panel {
        padding: 1.25rem;
    }

    .auth-card {
        padding: 1.75rem;
        border-radius: var(--auth-radius-md);
    }

    .form-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .otp-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}
