/* Authentication page styling - Clean and minimal per CONTEXT.md decisions */

:root {
    /* Brand color from graphics/color.txt */
    --brand-primary: #12415f;
    --brand-primary-light: #1a5a82;
    --brand-primary-dark: #0d2f45;

    /* Colors - Trustworthy and professional */
    --bg-primary: #f5f5f7;
    --bg-surface: #ffffff;
    --bg-surface-translucent: rgba(255, 255, 255, 0.95);
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --border-color: #d2d2d7;
    --shadow-subtle: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-strong: 0 8px 32px rgba(0, 0, 0, 0.2);

    /* Use brand color for buttons */
    --ms-blue: var(--brand-primary);
    --ms-blue-hover: var(--brand-primary-light);

    /* Semantic colors */
    --error-bg: #fef2f2;
    --error-border: #fca5a5;
    --error-text: #991b1b;
}

/* Reset and base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.auth-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--brand-primary) url('/static/img/background.jpeg') center center / cover no-repeat fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Auth container - Centered card */
.auth-container {
    background: var(--bg-surface-translucent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: var(--shadow-strong);
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

/* Branding */
.brand {
    margin-bottom: 1.5rem;
}

.logo {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 0.75rem;
}

.logo-img {
    width: 80px;
    height: auto;
    margin-bottom: 0.75rem;
}

.brand h1 {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* Tagline - Simple and trustworthy (per CONTEXT.md: not marketing-heavy) */
.tagline {
    color: var(--text-secondary);
    font-size: 0.938rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

/* Alert messages */
.alert {
    border-radius: 8px;
    padding: 0.875rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    text-align: left;
}

.alert-error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-text);
}

/* Login form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Remember me checkbox */
.remember-me {
    text-align: left;
}

.remember-me label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.938rem;
    color: var(--text-primary);
}

.remember-me input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
    accent-color: var(--ms-blue);
}

/* Microsoft sign-in button */
.btn-microsoft {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--ms-blue);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-subtle);
}

.btn-microsoft:hover {
    background: var(--ms-blue-hover);
    box-shadow: var(--shadow-medium);
    transform: translateY(-1px);
}

.btn-microsoft:active {
    transform: translateY(0);
    box-shadow: var(--shadow-subtle);
}

.btn-microsoft:focus {
    outline: 2px solid var(--ms-blue);
    outline-offset: 2px;
}

.ms-logo {
    width: 16px;
    height: 16px;
    color: #ffffff;
}

/* Security note - Trust indicator */
.security-note {
    margin-top: 2rem;
    color: var(--text-secondary);
    font-size: 0.813rem;
}

.security-note small {
    font-size: inherit;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .auth-container {
        padding: 2.5rem 1.5rem;
    }

    .brand h1 {
        font-size: 1.5rem;
    }

    .logo {
        font-size: 2.5rem;
    }

    .logo-img {
        width: 64px;
    }
}

/* Focus styles for keyboard navigation */
a:focus,
button:focus,
input:focus {
    outline: 2px solid var(--ms-blue);
    outline-offset: 2px;
}

/* Accessibility - Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Invitation UI Styles (Phase 6) */

/* Invite section */
.invite-section {
    background: var(--bg-surface, #f9fafb);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.section-heading {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary, #1d1d1f);
}

.invite-form {
    display: flex;
    flex-direction: column;
}

.form-group-inline {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.input-email {
    flex: 1;
    padding: 0.625rem 1rem;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 6px;
    font-size: 0.938rem;
    font-family: 'Inter', sans-serif;
    background: #ffffff;
    color: var(--text-primary, #1d1d1f);
    transition: border-color 0.2s ease;
}

.input-email:focus {
    outline: none;
    border-color: var(--brand-primary, #12415f);
    box-shadow: 0 0 0 3px rgba(18, 65, 95, 0.1);
}

/* Pending invitations section */
.pending-invitations-section {
    background: var(--bg-surface, #f9fafb);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.badge-count {
    display: inline-block;
    background: var(--brand-primary, #12415f);
    color: #ffffff;
    font-size: 0.813rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    margin-left: 0.5rem;
}

.invitations-table-container {
    margin-top: 1rem;
    overflow-x: auto;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.813rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-expired {
    background: #e5e7eb;
    color: #4b5563;
}

.status-accepted {
    background: #d1fae5;
    color: #065f46;
}

.actions-cell {
    white-space: nowrap;
}

.btn-danger {
    background: #dc2626;
    color: #ffffff;
    border: none;
}

.btn-danger:hover {
    background: #b91c1c;
}

/* Theme-aware invitation styles */
[data-theme="dark"] .invite-section,
[data-theme="dark"] .pending-invitations-section {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .input-email {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

[data-theme="dark"] .input-email:focus {
    border-color: var(--brand-primary-light, #1a5a82);
}

[data-theme="dark"] .section-heading {
    color: #ffffff;
}

[data-theme="dark"] .status-pending {
    background: rgba(254, 243, 199, 0.2);
    color: #fbbf24;
}

[data-theme="dark"] .status-expired {
    background: rgba(229, 231, 235, 0.2);
    color: #9ca3af;
}

[data-theme="dark"] .status-accepted {
    background: rgba(209, 250, 229, 0.2);
    color: #34d399;
}

[data-theme="hacker"] .invite-section,
[data-theme="hacker"] .pending-invitations-section {
    background: rgba(0, 255, 0, 0.05);
    border-color: rgba(0, 255, 0, 0.2);
}

[data-theme="hacker"] .input-email {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(0, 255, 0, 0.3);
    color: #00ff00;
}

[data-theme="hacker"] .input-email:focus {
    border-color: #00ff00;
    box-shadow: 0 0 0 3px rgba(0, 255, 0, 0.1);
}

[data-theme="hacker"] .section-heading {
    color: #00ff00;
}

[data-theme="hacker"] .status-pending {
    background: rgba(255, 255, 0, 0.2);
    color: #ffff00;
}

[data-theme="hacker"] .status-expired {
    background: rgba(128, 128, 128, 0.3);
    color: #808080;
}

[data-theme="hacker"] .status-accepted {
    background: rgba(0, 255, 0, 0.2);
    color: #00ff00;
}

/* Mobile responsive */
@media (max-width: 640px) {
    .form-group-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .input-email {
        width: 100%;
    }
}
