/**
 * GoToM8 Auth Common Styles
 * Split-screen layout for all authentication pages
 * Matches FigmaMake React AuthLayout pattern
 * Uses GoToM8 design tokens from gotom8-theme.css
 *
 * Phase 178: Wrapped in @layer project-tokens.
 */

@layer project-tokens {

/* ===== Auth Root — Split-Screen Container ===== */
.auth-root {
    --auth-primary:    var(--x-color-primary);
    --auth-primary-dk: var(--x-color-primary-hover);
    --auth-panel-from: var(--x-color-primary);
    --auth-panel-to:   var(--x-color-primary-active);

    display: flex;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ===== Left Panel — Form ===== */
.auth-left {
    flex: 0 0 50%;
    max-width: 680px;
    background: var(--x-color-card);
    display: flex;
    flex-direction: column;
    padding: 40px 56px;
}

.auth-brand {
    font-size: 20px;
    font-weight: 700;
    color: var(--x-color-foreground);
    letter-spacing: -0.3px;
}

.auth-form-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
}

/* ===== Typography ===== */
.auth-heading {
    font-size: 26px;
    font-weight: 700;
    color: var(--x-color-foreground);
    margin: 0 0 8px 0;
}

.auth-subheading {
    font-size: 14px;
    color: var(--x-color-muted-foreground);
    line-height: 1.55;
    margin: 0 0 28px 0;
}

/* ===== Form Fields ===== */
.auth-field-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 8px;
}

.auth-name-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ===== Forgot Password Link ===== */
.auth-forgot {
    text-align: right;
    margin: 8px 0 20px;
}
.auth-forgot a {
    font-size: 13px;
    font-weight: 500;
    color: var(--auth-primary);
    text-decoration: none;
}
.auth-forgot a:hover { text-decoration: underline; }

/* ===== Submit Button ===== */
.auth-submit-btn {
    width: 100%;
    padding: 13px 24px;
    background: var(--auth-primary);
    color: var(--x-color-primary-foreground);
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--x-transition-normal);
    letter-spacing: 0.1px;
}
.auth-submit-btn:hover:not(:disabled) { background: var(--auth-primary-dk); }
.auth-submit-btn:disabled { opacity: 0.65; cursor: not-allowed; }

/* ===== OR Divider ===== */
.auth-or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--x-color-muted-foreground);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.6px;
}
.auth-or::before, .auth-or::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--x-color-border);
}

/* ===== OAuth Buttons ===== */
.oauth-list { display: flex; flex-direction: column; gap: 10px; }

.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 20px;
    background: var(--x-color-card);
    border: 1px solid var(--x-color-border);
    border-radius: 8px;
    color: var(--x-color-foreground);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--x-transition-normal), border-color var(--x-transition-normal);
}
.oauth-btn:hover { background: var(--x-color-background); border-color: var(--x-color-border); }
.oauth-icon { width: 18px; height: 18px; flex-shrink: 0; }

/* ===== Footer Sign-In/Sign-Up Link ===== */
.auth-signup-link {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--x-color-muted-foreground);
}
.auth-signup-link a {
    color: var(--auth-primary);
    font-weight: 700;
    text-decoration: none;
}
.auth-signup-link a:hover { text-decoration: underline; }

/* ===== Error Alert ===== */
.auth-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: var(--x-color-destructive-muted);
    border-radius: var(--x-radius-lg);
    margin-bottom: 20px;
    color: var(--x-color-destructive);
    font-size: 13px;
}

.auth-error .error-icon,
.auth-error > svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.auth-error-close {
    margin-left: auto;
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--x-color-destructive);
    cursor: pointer;
    padding: 2px;
    line-height: 1;
    border-radius: 3px;
    transition: background var(--x-transition-normal);
}
.auth-error-close:hover { background: rgba(220, 38, 38, 0.1); }

/* ===== Success State ===== */
.auth-success-banner {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: var(--x-color-success-muted);
    border: 1px solid var(--x-color-success);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    color: var(--x-color-success-700);
    font-size: 14px;
}

.auth-success {
    text-align: center;
}

.success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    background: var(--x-color-success-muted);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-icon svg {
    width: 32px;
    height: 32px;
    color: var(--x-color-success);
}

.success-message {
    margin-bottom: 24px;
}

.email-highlight {
    font-weight: 600;
    color: var(--x-color-foreground);
}

/* ===== Back Link ===== */
.auth-back-link {
    margin-top: 24px;
    text-align: center;
}

.back-anchor {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--x-color-muted-foreground);
    text-decoration: none;
    font-size: 14px;
    transition: color var(--x-transition-normal);
}

.back-anchor:hover {
    color: var(--x-color-foreground);
}

.back-icon {
    width: 16px;
    height: 16px;
}

/* ===== Resend Section ===== */
.resend-section {
    margin-top: 24px;
}

.resend-btn {
    background: none;
    border: none;
    color: var(--auth-primary);
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    padding: 0;
    text-decoration: underline;
}

.resend-btn:hover { opacity: 0.8; }
.resend-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ===== Security Info Box ===== */
.auth-info-box {
    padding: 16px;
    border-radius: 8px;
    background: var(--x-color-info-muted);
    border-left: 4px solid var(--x-color-info);
    color: var(--x-color-info);
    font-size: 13px;
    line-height: 1.55;
    margin-top: 24px;
}

/* ===== Next Steps Box (Forgot Password success) ===== */
.auth-next-steps {
    padding: 24px;
    border-radius: 8px;
    background: var(--x-color-muted);
    text-align: left;
    margin-bottom: 24px;
}

.auth-next-steps ol {
    margin: 8px 0 0;
    padding-left: 24px;
    color: var(--x-color-muted-foreground);
    font-size: 14px;
    line-height: 1.8;
}

.auth-next-steps strong {
    color: var(--x-color-foreground);
}

/* ===== Dev Mode ===== */
.dev-section { margin-top: 20px; padding-top: 20px; border-top: 1px dashed var(--x-color-warning); }
.dev-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--x-color-warning-muted);
    border: 1px solid var(--x-color-warning);
    border-radius: var(--x-radius-md);
    margin-bottom: 10px;
    font-size: var(--x-text-xs);
    color: var(--x-color-warning-700);
}
.dev-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    border: 1px dashed var(--x-color-warning);
    border-radius: var(--x-radius-lg);
    background: var(--x-color-warning-50);
    color: var(--x-color-warning-700);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background var(--x-transition-normal);
}
.dev-link:hover { background: var(--x-color-warning-muted); }

/* ===== Right Panel — Hero ===== */
.auth-right {
    flex: 1;
    background: linear-gradient(160deg, var(--auth-panel-from) 0%, var(--auth-panel-to) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 64px 72px;
    position: relative;
    overflow: hidden;
}

.auth-right-inner {
    max-width: 560px;
    color: var(--x-color-primary-foreground);
    position: relative;
    z-index: 1;
}

.auth-hero-title {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.5px;
    margin: 0 0 16px 0;
}

.auth-hero-sub {
    font-size: 15px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.72);
    margin: 0 0 36px 0;
}

/* Testimonial */
.auth-testimonial {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 36px;
}

.auth-testimonial-quote {
    font-size: 14px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.88);
    font-style: italic;
    margin: 0 0 20px 0;
}

.auth-testimonial-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--x-color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--x-color-primary-foreground);
    flex-shrink: 0;
}

.auth-author-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--x-color-primary-foreground);
    margin: 0 0 2px 0;
}

.auth-author-role {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

/* Features grid */
.auth-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 24px;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.88);
}

.auth-check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Dot pattern background (matches React AuthLayout) */
.auth-right::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.05;
    background-image: radial-gradient(circle at 2px 2px, white 1px, transparent 0);
    background-size: 48px 48px;
    pointer-events: none;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .auth-right { display: none; }
    .auth-left { flex: 1; max-width: none; align-items: center; }
    .auth-form-wrap { max-width: 420px; }
}
@media (max-width: 768px) {
    .auth-left { padding: 32px 32px; }
}
@media (max-width: 640px) {
    .auth-left { padding: 24px 20px; }
    .auth-form-wrap { max-width: 100%; }
    .auth-heading { font-size: 22px; }
    .auth-name-row { grid-template-columns: 1fr; }
}

/* ===== Accessibility ===== */
@media (prefers-contrast: high) {
    .oauth-btn { border-width: 2px; }
}

@media (prefers-reduced-motion: reduce) {
    .oauth-btn,
    .auth-submit-btn,
    .back-anchor,
    .resend-btn {
        transition: none;
    }
}

/* Plain HTML form inputs for auth pages (no Blazor interactivity needed) */
.auth-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--x-color-foreground);
    background: var(--x-color-card);
    border: 1px solid var(--x-color-border);
    border-radius: var(--x-radius);
    outline: none;
    transition: border-color var(--x-transition-normal), box-shadow var(--x-transition-normal);
    box-sizing: border-box;
    margin-bottom: 4px;
}
.auth-input:focus {
    border-color: var(--x-color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.auth-input::placeholder {
    color: var(--x-color-muted-foreground);
}
.auth-field-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--x-color-foreground);
    margin-bottom: 6px;
    margin-top: 12px;
}
.auth-field-hint {
    display: block;
    font-size: 12px;
    color: var(--x-color-muted-foreground);
    margin-top: 2px;
    margin-bottom: 4px;
}

} /* end @layer project-tokens */
