/* SPX Design System Colors */
:root {
    /* Primary palette */
    --spx-asphalt-500: #071326;
    --spx-silver-500: #f7f9fc;
    --spx-blue-500: #3c73bb;
    --spx-blue-accent: #679de4;

    /* Secondary palette */
    --spx-green-500: #51c260;
    --spx-yellow-500: #ffc738;
    --spx-red-500: #f82512;

    /* Asphalt tints (dark mode surfaces) */
    --spx-asphalt-450: #131f34;
    --spx-asphalt-400: #1d2b43;
    --spx-asphalt-350: #253753;
    --spx-asphalt-300: #2d4265;

    /* Silver tints */
    --spx-silver-600: #dfe0e3;
    --spx-silver-400: #e8ecf3;
    --spx-silver-300: #babbbd;
}

/* Dark theme (default) */
[data-theme="dark"] {
    --theme-bg: var(--spx-asphalt-500);
    --theme-surface: var(--spx-asphalt-450);
    --theme-surface-alt: var(--spx-asphalt-400);
    --theme-surface-hover: var(--spx-asphalt-350);
    --theme-text-primary: var(--spx-silver-500);
    --theme-text-secondary: var(--spx-silver-300);
    --theme-text-muted: var(--spx-silver-400);
    --theme-border: var(--spx-asphalt-300);
    --theme-shadow: rgba(0, 0, 0, 0.4);
    --theme-status-info-bg: var(--spx-asphalt-400);
    --theme-status-info-text: var(--spx-silver-400);
    --theme-status-success-bg: rgba(81, 194, 96, 0.15);
    --theme-status-success-text: #8fd99a;
    --theme-status-error-bg: rgba(248, 37, 18, 0.15);
    --theme-status-error-text: #ff8a80;
}

/* Light theme */
[data-theme="light"] {
    --theme-bg: var(--spx-silver-500);
    --theme-surface: #ffffff;
    --theme-surface-alt: var(--spx-silver-400);
    --theme-surface-hover: var(--spx-silver-600);
    --theme-text-primary: var(--spx-asphalt-500);
    --theme-text-secondary: var(--spx-asphalt-300);
    --theme-text-muted: var(--spx-asphalt-400);
    --theme-border: var(--spx-silver-300);
    --theme-shadow: rgba(0, 0, 0, 0.15);
    --theme-status-info-bg: var(--spx-silver-400);
    --theme-status-info-text: var(--spx-asphalt-400);
    --theme-status-success-bg: #e6f7e8;
    --theme-status-success-text: #1a5c26;
    --theme-status-error-bg: #fde8e6;
    --theme-status-error-text: #8c1a10;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--theme-bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: background-color 0.2s ease;
}

.container {
    background: var(--theme-surface);
    border-radius: 4px;
    box-shadow: 0 4px 24px var(--theme-shadow);
    padding: 40px;
    max-width: 440px;
    width: 100%;
    position: relative;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.theme-toggle {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--theme-surface-alt);
    border: 1px solid var(--theme-border);
    border-radius: 4px;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.theme-toggle:hover {
    background: var(--theme-surface-hover);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    fill: var(--theme-text-secondary);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
}

[data-theme="light"] .theme-toggle .icon-moon {
    display: block;
}

.logo-section {
    text-align: center;
    margin-bottom: 32px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: var(--spx-blue-500);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.logo-icon svg {
    width: 28px;
    height: 28px;
    fill: white;
}

h1 {
    color: var(--theme-text-primary);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
    transition: color 0.2s ease;
}

.subtitle {
    color: var(--theme-text-secondary);
    font-size: 14px;
    transition: color 0.2s ease;
}

.info-box {
    background: var(--theme-surface-alt);
    border-left: 3px solid var(--spx-blue-500);
    padding: 14px 16px;
    margin-bottom: 24px;
    border-radius: 2px;
    transition: background-color 0.2s ease;
}

.info-box p {
    color: var(--theme-text-muted);
    font-size: 14px;
    line-height: 1.5;
    transition: color 0.2s ease;
}

.button-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-button {
    background: var(--spx-blue-500);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-button:hover {
    background: var(--spx-blue-accent);
    box-shadow: 0 2px 8px rgba(60, 115, 187, 0.3);
}

.auth-button:active {
    background: var(--spx-asphalt-300);
}

.auth-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-button:focus {
    outline: 2px solid var(--spx-blue-accent);
    outline-offset: 2px;
}

.auth-button svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    flex-shrink: 0;
}

.button-text {
    flex: 1;
    text-align: left;
}

.button-label {
    display: block;
}

.button-description {
    font-size: 12px;
    opacity: 0.85;
    font-weight: 400;
    margin-top: 2px;
}

.auth-button.secondary {
    background: transparent;
    color: var(--theme-text-primary);
    border: 1px solid var(--theme-border);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.auth-button.secondary:hover {
    background: var(--theme-surface-hover);
    border-color: var(--theme-text-secondary);
    box-shadow: none;
}

.auth-button.secondary:active {
    background: var(--theme-surface-alt);
}

.status-message {
    margin-top: 20px;
    padding: 12px 14px;
    border-radius: 4px;
    font-size: 14px;
    display: none;
    align-items: flex-start;
    gap: 10px;
}

.status-message svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.status-message.info {
    background: var(--theme-status-info-bg);
    color: var(--theme-status-info-text);
}

.status-message.info svg {
    fill: var(--spx-blue-accent);
}

.status-message.success {
    background: var(--theme-status-success-bg);
    color: var(--theme-status-success-text);
}

.status-message.success svg {
    fill: var(--spx-green-500);
}

.status-message.error {
    background: var(--theme-status-error-bg);
    color: var(--theme-status-error-text);
}

.status-message.error svg {
    fill: var(--spx-red-500);
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

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

.footer {
    margin-top: 28px;
    text-align: center;
    color: var(--theme-text-secondary);
    font-size: 12px;
    transition: color 0.2s ease;
}

.sectra-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
}

.sectra-logo svg {
    height: 16px;
    width: auto;
    fill: var(--theme-text-secondary);
    transition: fill 0.2s ease;
}

@media (max-width: 600px) {
    .container {
        padding: 24px;
    }

    h1 {
        font-size: 20px;
    }
}
