:root {
    --bg: #fafaf8;
    --bg-secondary: #f5f2ed;
    --surface: #ffffff;
    --surface-hover: #f9f7f4;
    --text: #1a1815;
    --text-secondary: #6b6562;
    --text-muted: #9b9491;
    --accent: #c66c5a;
    --accent-light: #e8d5ce;
    --accent-dark: #8b4a3f;
    --border: #e8e4df;
    --error: #d32f2f;
    --error-light: #ffebee;
    --success: #388e3c;
    --success-light: #e8f5e9;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    line-height: 1.6;
}

/* --- TYPOGRAPHY --- */

h1 {
    font-family: "Instrument Serif", serif;
    font-size: 3rem;
    font-weight: 400;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.5px;
}

h2 {
    font-family: "Instrument Serif", serif;
    font-size: 1.75rem;
    font-weight: 400;
    color: var(--text);
    margin-bottom: 28px;
    letter-spacing: -0.3px;
}

/* --- LAYOUT --- */

.app {
    width: 100%;
    max-width: 700px;
    padding: 48px 24px 160px;
}

.header {
    margin-bottom: 48px;
    text-align: center;
}

.tagline {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 8px;
    font-style: italic;
    letter-spacing: 0.5px;
}

/* --- AUTHENTICATION --- */

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.auth-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-color: var(--accent-light);
}

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

.input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.input-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.input-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.auth-card input,
#todoInput {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: all 0.2s ease;
    font-family: "Inter", sans-serif;
}

.auth-card input::placeholder,
#todoInput::placeholder {
    color: var(--text-muted);
}

.auth-card input:focus,
#todoInput:focus {
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(198, 108, 90, 0.1);
}

/* --- BUTTONS --- */

.btn {
    border: none;
    border-radius: 12px;
    padding: 14px 20px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    letter-spacing: 0.3px;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: var(--accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(198, 108, 90, 0.3);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text);
    border: 1px solid var(--border);
    flex: 1;
}

.btn-secondary:hover:not(:disabled) {
    background: var(--surface-hover);
    border-color: var(--accent);
}

.btn-icon {
    padding: 10px 12px;
    background: var(--bg-secondary);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-icon:hover:not(:disabled) {
    background: var(--error-light);
    color: var(--error);
    border-color: var(--error);
}

.auth-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    margin-bottom: 16px;
}

.auth-hint {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 12px;
}

.auth-hint button:disabled {
    color: var(--text-muted);
    opacity: 0.6;
    cursor: not-allowed;
}

/* --- USER BAR --- */

.user-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    background: var(--surface);
    padding: 16px 20px;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info i {
    font-size: 24px;
    color: var(--accent);
}

.user-info-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

#userName {
    font-size: 14px;
    color: var(--text);
    font-weight: 600;
}

#userName:empty {
    display: none;
}

#userEmail {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* --- TODO LIST --- */

.todo-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.todo-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.3s ease;
}

.todo-item:hover {
    background: var(--surface-hover);
    border-color: var(--accent-light);
    box-shadow: 0 2px 8px rgba(198, 108, 90, 0.1);
}

.todo-item.completed {
    opacity: 0.7;
}

.todo-text {
    flex: 1;
    font-size: 15px;
    color: var(--text);
    transition: all 0.3s ease;
}

.todo-item.completed .todo-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

/* --- ICON BUTTONS --- */

.icon-btn {
    border: none;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 4px;
}

.icon-btn:hover {
    color: var(--accent);
    transform: scale(1.1);
}

.delete-btn:hover {
    color: var(--error);
}

.todo-item.completed .check-btn {
    color: var(--success);
}

/* --- INPUT CONTAINER --- */

.input-container {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 660px;
    z-index: 10;
}

.input-wrapper {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(10px);
}

.input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 15px;
    padding: 10px 12px;
}

.add-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: var(--accent);
    color: white;
    cursor: pointer;
    font-size: 20px;
    display: grid;
    place-items: center;
    transition: all 0.3s ease;
}

.add-btn:hover:not(:disabled) {
    background: var(--accent-dark);
    transform: scale(1.05);
}

.add-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.add-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* --- NOTIFICATIONS/TOASTS --- */

.notification-container {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 100;
    max-width: 380px;
    width: calc(100% - 48px);
}

.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    animation: slideIn 0.3s ease forwards;
    transition: all 0.3s ease;
}

.toast i {
    font-size: 20px;
    margin-top: 2px;
    flex-shrink: 0;
}

.toast-text {
    font-size: 14px;
    line-height: 1.4;
    color: var(--text);
    flex: 1;
}

/* Toast variants */
.toast.error {
    background: var(--error-light);
    border-color: var(--error);
}

.toast.error i {
    color: var(--error);
}

.toast.success {
    background: var(--success-light);
    border-color: var(--success);
}

.toast.success i {
    color: var(--success);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* --- VERIFICATION SCREEN SPECIFIC --- */

#verificationCard ol {
    margin-left: 16px;
    margin-top: 8px;
    color: inherit;
}

#verificationCard li {
    margin-bottom: 4px;
}

/* --- UTILITY CLASSES --- */

.hidden {
    display: none !important;
}

/* --- RESPONSIVE DESIGN --- */

@media (max-width: 600px) {
    h1 {
        font-size: 2.2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .app {
        padding: 32px 16px 160px;
    }

    .header {
        margin-bottom: 36px;
    }

    .auth-card {
        padding: 28px;
    }

    .input-container {
        width: calc(100% - 16px);
        max-width: none;
        bottom: 16px;
    }

    .input-wrapper {
        border-radius: 16px;
        padding: 10px;
    }

    .todo-item {
        padding: 14px;
        font-size: 14px;
    }

    .notification-container {
        left: 8px;
        right: 8px;
        width: auto;
    }

    .toast {
        padding: 12px 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* --- AUTH SWITCH TABS --- */
.auth-toggle {
    display: flex;
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.toggle-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.toggle-tab.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}
