/**
 * Auth Pages Styles — Dark Theme
 * External CSS to comply with Content Security Policy.
 * Used by login.blade.php and register.blade.php.
 * Pure CSS — no Bootstrap/Tailwind.
 *
 * @package    HoloSuiteAI
 * @subpackage Public
 * @version    2.0.0
 */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #0f172a;
    --bg-warning: rgba(245, 158, 11, 0.1);
    --border-color: #334155;
    --border-focus: #6366f1;
    --border-warning: #f59e0b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-warning: #fbbf24;
    --accent-primary: #6366f1;
    --accent-hover: #818cf8;
    --color-error: #ef4444;
    --color-success: #22c55e;
    --radius-md: 8px;
    --radius-lg: 12px;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html,
body {
    min-height: 100vh;
}

body {
    font-family: var(--font-family);
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
 * AUTH CONTAINER & CARD
 * ============================================================ */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
}

.auth-card.wide {
    max-width: 480px;
}

/* ============================================================
 * BRAND / LOGO
 * ============================================================ */
.auth-brand {
    text-align: center;
    margin-bottom: 1.5rem;
}

.brand-link {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.brand-link:hover {
    color: var(--accent-primary);
}

/* ============================================================
 * HEADER
 * ============================================================ */
.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2rem;
}

/* ============================================================
 * STATUS MESSAGES
 * ============================================================ */
.message-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid var(--color-success);
    color: var(--color-success);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.message-error {
    font-size: 0.8rem;
    color: var(--color-error);
    margin-top: 0.35rem;
}

/* ============================================================
 * AGE WARNING BANNER (Register)
 * ============================================================ */
.age-warning {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--bg-warning);
    border: 1px solid var(--border-warning);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.warning-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.age-warning span:last-child {
    font-size: 0.875rem;
    color: var(--text-warning);
    font-weight: 500;
}

/* ============================================================
 * OAUTH GRID — 2x2 Layout
 * ============================================================ */
.oauth-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.oauth-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s;
}

.oauth-button:hover {
    border-color: var(--accent-primary);
    background: var(--bg-card);
}

.oauth-button svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ============================================================
 * DIVIDER
 * ============================================================ */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* ============================================================
 * ACCOUNT TYPE SELECTION (Register)
 * ============================================================ */
.account-type-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.account-type-option {
    position: relative;
    padding: 1rem;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color 0.2s;
}

.account-type-option:hover {
    border-color: var(--text-muted);
}

.account-type-option.selected {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

.account-type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.account-type-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.account-type-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.account-type-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ============================================================
 * FORM FIELDS
 * ============================================================ */
.field-wrapper {
    margin-bottom: 1.25rem;
}

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

.field-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color 0.2s;
}

.field-input:focus {
    border-color: var(--border-focus);
}

.field-input.has-error {
    border-color: var(--color-error);
}

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

/* Two-column Grid for Name Fields */
.field-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* ============================================================
 * FORM OPTIONS (Remember + Forgot)
 * ============================================================ */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.toggle-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-primary);
}

.link-text {
    font-size: 0.875rem;
    color: var(--accent-primary);
    text-decoration: none;
    transition: opacity 0.2s;
}

.link-text:hover {
    opacity: 0.8;
}

/* ============================================================
 * TERMS CHECKBOX (Register)
 * ============================================================ */
.terms-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.terms-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--accent-primary);
    flex-shrink: 0;
}

.terms-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.terms-text a {
    color: var(--accent-primary);
    text-decoration: none;
}

.terms-text a:hover {
    text-decoration: underline;
}

/* ============================================================
 * PRIMARY BUTTON
 * ============================================================ */
.button-primary {
    display: block;
    width: 100%;
    padding: 0.85rem;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    background: var(--accent-primary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.button-primary:hover {
    background: var(--accent-hover);
}

.button-primary:active {
    transform: scale(0.98);
}

.button-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================================
 * FOOTER LINK
 * ============================================================ */
.auth-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ============================================================
 * RESPONSIVE
 * ============================================================ */
@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .oauth-grid,
    .account-type-grid,
    .field-row {
        grid-template-columns: 1fr;
    }
}
