/**
 * Simple Auth CSS (KISS)
 * Aligns visuals with the new mountAuth UI.
 *
 * Scope: Mostly scoped to .auth-container subtree to avoid leaking styles globally.
 * You can override CSS variables below to theme.
 */

/* Root Variables */
:root {
    --auth-primary: #3b82f6;
    --auth-primary-hover: #2563eb;
    --auth-surface: #ffffff;
    --auth-text: #111827;
    --auth-muted: #6b7280;
    --auth-border: #e5e7eb;
    --auth-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    --auth-shadow-hover: 0 15px 50px rgba(0, 0, 0, 0.15);

    /* Accent/gradient */
    --auth-gradient-start: #475569;
    --auth-gradient-end: #334155;

    /* Radii and spacing */
    --auth-radius: 12px;
    --auth-field-radius: 8px;

    /* Spinner */
    --auth-spinner-size: 1rem;
    --auth-spinner-color: var(--auth-primary);
}

/* Container */
.auth-container {
    width: 100%;
    max-width: 420px;
    margin: 3rem auto;
    animation: auth-fade-in 0.4s ease-in;
    color: var(--auth-text);
}

/* Card */
.auth-card {
    background: var(--auth-surface);
    border-radius: var(--auth-radius);
    box-shadow: var(--auth-shadow);
    padding: 2rem;
    transition:
        box-shadow 0.25s ease,
        transform 0.2s ease;
}
.auth-card:hover {
    box-shadow: var(--auth-shadow-hover);
    transform: translateY(-1px);
}

/* Header */
.auth-header {
    text-align: center;
    margin-bottom: 1.5rem;
}
.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--auth-primary);
    margin: 0 0 0.25rem 0;
}
.auth-subtitle {
    color: var(--auth-muted);
    font-size: 0.95rem;
    margin: 0;
}

/* Status Messages */
.auth-container .alert {
    border-radius: 8px;
    padding: 0.875rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    border: 1px solid transparent;
    animation: auth-slide-down 0.3s ease;
}
.auth-container .alert-success {
    background-color: #d1f4e0;
    border-color: #a3e3c4;
    color: #0f5132;
}
.auth-container .alert-danger {
    background-color: #f8d7da;
    border-color: #f1aeb5;
    color: #842029;
}
.auth-container .alert-info {
    background-color: #cfe2ff;
    border-color: #9ec5fe;
    color: #084298;
}

/* Forms */
.auth-container .form-label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.92rem;
}

.auth-container .form-control {
    width: 100%;
    border-radius: var(--auth-field-radius);
    border: 2px solid #e5e7eb;
    padding: 0.7rem 0.9rem;
    font-size: 0.95rem;
    line-height: 1.25rem;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
    background: #fff;
    color: #111827;
    outline: none;
    box-sizing: border-box;
}
.auth-container .form-control::placeholder {
    color: #9ca3af;
}
.auth-container .form-control:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 0.15rem rgba(59, 130, 246, 0.25);
}

/* Form check */
.auth-container .form-check {
    padding-left: 1.75rem;
    margin-bottom: 0.75rem;
    position: relative;
}
.auth-container .form-check-input {
    width: 1.1rem;
    height: 1.1rem;
    position: absolute;
    left: 0;
    top: 0.15rem;
    margin: 0;
    appearance: none;
    border: 2px solid var(--auth-border);
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}
.auth-container .form-check-input:checked {
    background-color: var(--auth-primary);
    border-color: var(--auth-primary);
    box-shadow: inset 0 0 0 2px #fff;
}
.auth-container .form-check-label {
    cursor: pointer;
    font-size: 0.95rem;
    color: #374151;
}

/* Buttons */
.auth-container .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    padding: 0.7rem 1.1rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    transition:
        transform 0.15s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease,
        color 0.2s ease;
    text-decoration: none;
    background: #f9fafb;
    color: #111827;
}
.auth-container .btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}
.auth-container .btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.auth-container .btn-primary {
    background: linear-gradient(135deg, var(--auth-gradient-start), var(--auth-gradient-end));
    color: #fff;
    border: none;
}
.auth-container .btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--auth-primary-hover), var(--auth-gradient-end));
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.35);
}

.auth-container .btn-outline-primary {
    background: transparent;
    color: var(--auth-primary);
    border-color: var(--auth-primary);
}
.auth-container .btn-outline-primary:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.08);
    color: var(--auth-primary-hover);
}

.auth-container .btn-outline-secondary {
    background: transparent;
    color: #374151;
    border-color: #9ca3af;
}
.auth-container .btn-outline-secondary:hover:not(:disabled) {
    background: #f3f4f6;
    color: #111827;
}

.auth-container .btn-link {
    background: transparent;
    border: none;
    color: var(--auth-primary);
    padding: 0;
    font-weight: 500;
}
.auth-container .btn-link:hover {
    color: var(--auth-primary-hover);
    text-decoration: underline;
}

/* Spinner */
@keyframes auth-spin {
    to {
        transform: rotate(360deg);
    }
}
.auth-container .spinner-border {
    display: inline-block;
    width: var(--auth-spinner-size);
    height: var(--auth-spinner-size);
    border: 0.15em solid rgba(0, 0, 0, 0.1);
    border-right-color: var(--auth-spinner-color);
    border-radius: 50%;
    animation: auth-spin 0.75s linear infinite;
}

/* Utility layout helpers (minimal set) */
.auth-container .w-100 {
    width: 100%;
}
.auth-container .mb-2 {
    margin-bottom: 0.5rem;
}
.auth-container .mb-3 {
    margin-bottom: 0.75rem;
}
.auth-container .mb-4 {
    margin-bottom: 1rem;
}
.auth-container .text-center {
    text-align: center;
}
.auth-container .small {
    font-size: 0.875rem;
}
.auth-container .px-3 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}
.auth-container .d-grid {
    display: grid;
}
.auth-container .gap-2 {
    gap: 0.5rem;
}

/* Divider "OR" (works even without a utility framework) */
.auth-container .position-relative {
    position: relative;
}
.auth-container .position-absolute {
    position: absolute;
}
.auth-container .top-50 {
    top: 50%;
}
.auth-container .start-50 {
    left: 50%;
}
.auth-container .translate-middle {
    transform: translate(-50%, -50%);
}

/* Links */
.auth-container a {
    color: var(--auth-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}
.auth-container a:hover {
    color: var(--auth-primary-hover);
    text-decoration: underline;
}

/* View transitions */
.auth-container .auth-view {
    animation: auth-fade-in 0.25s ease;
}

/* Animations */
@keyframes auth-fade-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes auth-slide-down {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Accessibility */
.auth-container *:focus-visible {
    outline: 2px solid var(--auth-primary);
    outline-offset: 2px;
}

/* Responsive */
@media (max-width: 576px) {
    .auth-card {
        padding: 1.5rem;
    }
    .auth-title {
        font-size: 1.5rem;
    }
    .auth-subtitle {
        font-size: 0.9rem;
    }
}

/* Optional full-page background helper (use on host page if desired)
   Example:
     body {
       background: linear-gradient(135deg, var(--auth-gradient-start), var(--auth-gradient-end));
       min-height: 100vh;
       display: grid;
       place-items: center;
     }
*/
