:root {
    --primary: #007AFF;
    --primary-dark: #0056b3;
    --background: #0a0a0f;
    --surface: #1a1a24;
    --surface-light: #2a2a3a;
    --text: #ffffff;
    --text-secondary: #8a8a9a;
    --success: #34c759;
    --warning: #ff9500;
    --error: #ff3b30;
    --border-radius: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--surface);
    margin-bottom: 24px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}

.header-logo:hover {
    opacity: 0.9;
}

.logo-icon {
    width: 36px;
    height: auto;
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header h1 {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header .logo {
    font-size: 28px;
}

.nav-links {
    display: flex;
    gap: 16px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 16px;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Pushcode Display */
.pushcode-display {
    text-align: center;
    padding: 32px;
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-light) 100%);
    border-radius: var(--border-radius);
    position: relative;
    overflow: hidden;
}

.pushcode-display::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 122, 255, 0.1) 0%, transparent 70%);
    animation: glow 3s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.pushcode-code {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 48px;
    font-weight: 700;
    letter-spacing: 12px;
    color: var(--text);
    position: relative;
    z-index: 1;
    text-shadow: 0 0 30px rgba(0, 122, 255, 0.5);
}

.pushcode-placeholder {
    color: var(--text-secondary);
    text-shadow: none;
}

.pushcode-expires {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 12px;
    position: relative;
    z-index: 1;
}

.pushcode-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
    position: relative;
    z-index: 1;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background: var(--surface-light);
    color: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--surface-light);
    color: var(--text);
}

.btn-secondary:hover {
    background: #3a3a4a;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--surface-light);
    color: var(--text);
}

.btn-outline:hover {
    background: var(--surface-light);
}

.btn-danger {
    background: var(--error);
    color: white;
}

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

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* Status Indicator */
.status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--surface);
    border-radius: var(--border-radius);
    margin-bottom: 16px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.none { background: #666; }
.status-dot.ready { background: var(--warning); animation: pulse 2s infinite; }
.status-dot.artifact-ready { background: var(--success); animation: pulse 1s infinite; }
.status-dot.downloaded { background: var(--primary); }
.status-dot.expired { background: var(--error); }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-text {
    flex-grow: 1;
    font-size: 14px;
}

.status-size {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--surface-light);
    border-radius: 10px;
    color: var(--text);
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-input::placeholder {
    color: var(--text-secondary);
}

.form-input.code-input {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 24px;
    letter-spacing: 8px;
    text-align: center;
    text-transform: uppercase;
}

.form-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* File Drop Zone */
.dropzone {
    border: 2px dashed var(--surface-light);
    border-radius: var(--border-radius);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--primary);
    background: rgba(0, 122, 255, 0.05);
}

.dropzone-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.dropzone-text {
    color: var(--text-secondary);
    font-size: 14px;
}

.dropzone-file {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--surface-light);
    border-radius: 8px;
    margin-top: 16px;
}

.dropzone-file-icon {
    font-size: 24px;
}

.dropzone-file-name {
    flex-grow: 1;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropzone-file-size {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Progress Bar */
.progress {
    height: 4px;
    background: var(--surface-light);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 16px;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 16px;
}

.stat-icon {
    font-size: 20px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Profile */
.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: var(--surface);
    border-radius: var(--border-radius);
    margin-bottom: 24px;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(0, 122, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    color: var(--primary);
}

.profile-info {
    flex-grow: 1;
}

.profile-name {
    font-size: 18px;
    font-weight: 600;
}

.profile-email {
    font-size: 14px;
    color: var(--text-secondary);
}

.profile-auth {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

/* Settings List */
.settings-list {
    list-style: none;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--surface-light);
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item-label {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-item-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.settings-item-text {
    font-size: 15px;
}

.settings-item-value {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Toggle Switch */
.toggle {
    position: relative;
    width: 50px;
    height: 28px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--surface-light);
    border-radius: 28px;
    transition: 0.3s;
}

.toggle-slider::before {
    position: absolute;
    content: '';
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

/* Alerts */
.alert {
    padding: 16px;
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success {
    background: rgba(52, 199, 89, 0.15);
    color: var(--success);
}

.alert-error {
    background: rgba(255, 59, 48, 0.15);
    color: var(--error);
}

.alert-info {
    background: rgba(0, 122, 255, 0.15);
    color: var(--primary);
}

/* Login Page */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-logo {
    font-size: 64px;
    margin-bottom: 16px;
}

.login-logo-img {
    width: 280px;
    max-width: 80%;
    height: auto;
    margin-bottom: 16px;
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-subtitle {
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 16px;
}

.login-card {
    width: 100%;
    max-width: 400px;
}

.login-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--surface-light);
}

.login-divider span {
    padding: 0 16px;
}

/* YubiKey indicator */
.yubikey-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(52, 199, 89, 0.15);
    color: var(--success);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* Footer */
.footer {
    margin-top: auto;
    padding: 24px 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    border-top: 1px solid var(--surface);
}

.footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

.footer a:hover {
    color: var(--primary);
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Language Switcher */
.language-switcher {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

.lang-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-size: 20px;
    text-decoration: none;
    border-radius: 8px;
    background: var(--surface);
    transition: all 0.2s ease;
    opacity: 0.6;
}

.lang-link:hover {
    background: var(--surface-light);
    opacity: 1;
    transform: scale(1.1);
}

.lang-link.active {
    opacity: 1;
    background: var(--surface-light);
    box-shadow: 0 0 0 2px var(--primary);
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 16px;
    }

    .pushcode-code {
        font-size: 36px;
        letter-spacing: 8px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .language-switcher {
        gap: 8px;
    }

    .lang-link {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
}
