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

:root {
    /* Light Theme Colors */
    --bg-primary: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border-color: #e0e0e0;
    --shadow-sm: rgba(0, 0, 0, 0.05);
    --shadow-md: rgba(0, 0, 0, 0.08);
    --input-bg: #ffffff;
    --input-border: #e0e0e0;
}

[data-theme="dark"] {
    /* Dark Theme Colors */
    --bg-primary: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --bg-secondary: #1e293b;
    --bg-card: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #cbd5e1;
    --border-color: #475569;
    --shadow-sm: rgba(0, 0, 0, 0.3);
    --shadow-md: rgba(0, 0, 0, 0.4);
    --input-bg: #1e293b;
    --input-border: #475569;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--bg-primary);
    min-height: 100vh;
}

/* Navigation */
.navbar {
    background: var(--bg-secondary);
    padding: 1rem 2rem;
    box-shadow: 0 2px 8px var(--shadow-sm);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    width: 40px;
    height: 40px;
    color: #00d4aa;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    display: inline-flex;
    gap: 0.02rem;
    align-items: center;
}

/* Two-tone logo children (copied from global styles to ensure consistency) */
.logo-text .logo-exam {
    color: var(--text-primary);
    transition: color 0.2s ease;
    display: inline-block;
    margin-right: 0.02rem;
    letter-spacing: normal;
}

.logo-text .logo-vault {
    background: linear-gradient(135deg, #00d4aa 0%, #00a3ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    letter-spacing: -0.01em;
}

/* Dark theme adjustments */
[data-theme="dark"] .logo-text .logo-exam {
    color: var(--text-primary);
}

/* Prevent link/active/visited styles from overriding the gradient */
.logo a, .logo a:link, .logo a:visited, .logo a:active {
    color: inherit;
    text-decoration: none;
}

.logo a .logo-vault, .logo a:visited .logo-vault, .logo a:active .logo-vault {
    background: linear-gradient(135deg, #00d4aa 0%, #00a3ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Sign In Container */
.signin-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
    padding: 2rem;
}

.signin-card {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 10px 40px var(--shadow-md);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
}

.card-header {
    height: 8px;
    background: linear-gradient(90deg, #00d4aa 0%, #00a3ff 100%);
}

.card-content {
    padding: 3rem 2.5rem;
}

.signin-title {
    font-size: 2rem;
    font-weight: 700;
    color: #00d4aa;
    text-align: center;
    margin-bottom: 0.5rem;
}

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

/* Form Styles */
.signin-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
    display: none; /* Hidden but accessible */
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    padding-right: 3rem;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
    background: var(--input-bg);
    color: var(--text-primary);
}

.form-input:focus {
    border-color: #00a3ff;
    box-shadow: 0 0 0 3px rgba(0, 163, 255, 0.1);
}

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

.input-icon {
    position: absolute;
    right: 1rem;
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
}

.toggle-password {
    position: absolute;
    right: 0;
    background: none;
    border: none;
    padding: 0.875rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover .input-icon {
    color: #00a3ff;
}

/* Buttons */
.btn-signin {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #e0e0e0 0%, #d0d0d0 100%);
    color: #999;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: not-allowed;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

.btn-signin:not(:disabled) {
    background: linear-gradient(135deg, #00d4aa 0%, #00a3ff 100%);
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 163, 255, 0.3);
}

.btn-signin:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 163, 255, 0.4);
}

.btn-icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.forgot-password {
    text-align: center;
    color: #00a3ff;
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: #0080cc;
    text-decoration: underline;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #ddd;
}

.divider span {
    padding: 0 1rem;
    color: #999;
    font-size: 0.875rem;
}

.btn-create-account {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: white;
    color: #00a3ff;
    border: 2px solid #00a3ff;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-create-account:hover {
    background: #f0f8ff;
    transform: translateY(-2px);
}

.btn-google {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow-sm);
}

.btn-google:hover {
    background: var(--bg-card);
    border-color: #00a3ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-md);
}

.btn-google svg {
    width: 20px;
    height: 20px;
}

.error-message {
    color: #c33;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: block;
    min-height: 1rem;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header.success-header {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

.modal-header.error-header {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
}

.modal-icon {
    width: 60px;
    height: 60px;
    color: #28a745;
    margin: 0 auto 1rem;
    display: block;
}

.error-header .modal-icon {
    color: #dc3545;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: #155724;
    margin: 0;
}

.error-header h2 {
    color: #721c24;
}

.modal-body {
    padding: 2rem;
    text-align: center;
}

.modal-body p {
    color: #6c757d;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #00d4aa 0%, #00a3ff 100%);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 163, 255, 0.3);
}

/* Responsive Design */
@media (max-width: 480px) {
    .card-content {
        padding: 2rem 1.5rem;
    }

    .signin-title {
        font-size: 1.75rem;
    }

    .signin-subtitle {
        font-size: 0.875rem;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1.5rem;
    }
}
