/* ==========================================================================
   FysioTracker - "Gentle Momentum" Design System
   A warm, encouraging interface for daily physio tracking
   ========================================================================== */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=DM+Sans:ital,wght@0,400;0,500;0,700;1,400&display=swap');

/* ==========================================================================
   CSS Custom Properties
   ========================================================================== */
:root {
    /* Colors - Warm, healing palette */
    --color-sage: #7C9A82;
    --color-sage-light: #9BB5A0;
    --color-sage-dark: #5A7A60;
    --color-coral: #E8A87C;
    --color-coral-light: #F4C4A5;
    --color-coral-dark: #D4896A;
    --color-cream: #FAF8F5;
    --color-cream-dark: #F0EDE8;
    --color-charcoal: #2D3436;
    --color-charcoal-light: #636E72;
    --color-mint: #A8E6CF;
    --color-mint-dark: #7DD3AE;
    --color-rose: #FFB5B5;
    --color-white: #FFFFFF;

    /* Semantic colors */
    --color-primary: var(--color-sage);
    --color-primary-light: var(--color-sage-light);
    --color-accent: var(--color-coral);
    --color-success: var(--color-mint);
    --color-danger: var(--color-rose);
    --color-bg: var(--color-cream);
    --color-surface: var(--color-white);
    --color-text: var(--color-charcoal);
    --color-text-muted: var(--color-charcoal-light);

    /* Typography */
    --font-display: 'Outfit', -apple-system, sans-serif;
    --font-body: 'DM Sans', -apple-system, sans-serif;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(45, 52, 54, 0.06);
    --shadow-md: 0 4px 20px rgba(45, 52, 54, 0.08);
    --shadow-lg: 0 8px 40px rgba(45, 52, 54, 0.12);
    --shadow-glow: 0 0 40px rgba(124, 154, 130, 0.2);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Subtle grain texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.02;
    pointer-events: none;
    z-index: 9999;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.2;
}

h2 {
    font-size: 1.75rem;
    margin-bottom: var(--space-lg);
}

h3 {
    font-size: 1.125rem;
    font-weight: 500;
}

p {
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-sage-dark);
}

/* ==========================================================================
   Navigation
   ========================================================================== */
nav {
    background: var(--color-surface);
    padding: var(--space-md) var(--space-xl);
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    border-bottom: 1px solid var(--color-cream-dark);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
}

nav h1 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-sage) 0%, var(--color-sage-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

nav ul {
    list-style: none;
    display: flex;
    gap: var(--space-xs);
    flex: 1;
}

nav ul a {
    display: block;
    padding: var(--space-sm) var(--space-md);
    color: var(--color-text-muted);
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
}

nav ul a:hover {
    color: var(--color-text);
    background: var(--color-cream);
}

nav ul a.active {
    color: var(--color-white);
    background: var(--color-primary);
}

.logout-btn {
    margin-left: auto;
    padding: var(--space-sm) var(--space-lg);
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-muted);
    border: 1px solid var(--color-cream-dark);
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
}

.logout-btn:hover {
    color: var(--color-text);
    border-color: var(--color-charcoal-light);
    background: var(--color-cream);
}

/* ==========================================================================
   Main Content
   ========================================================================== */
main {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-xl);
}

/* ==========================================================================
   Dashboard
   ========================================================================== */
.dashboard {
    animation: fadeInUp 0.6s ease-out;
}

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

/* Streak Banner */
.streak-banner {
    position: relative;
    background: linear-gradient(135deg, var(--color-sage-light) 0%, var(--color-sage) 50%, var(--color-sage-dark) 100%);
    color: var(--color-white);
    padding: var(--space-2xl) var(--space-xl);
    border-radius: var(--radius-xl);
    text-align: center;
    margin-bottom: var(--space-xl);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    overflow: hidden;
}

.streak-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.15) 0%, transparent 70%);
    pointer-events: none;
}

.streak-banner.complete {
    background: linear-gradient(135deg, var(--color-mint) 0%, var(--color-mint-dark) 50%, var(--color-sage) 100%);
}

/* Celebration: Only animate when transitioning to complete (not on page load) */
.streak-banner.complete.celebrating {
    animation: celebratePulse 2s ease-out;
    overflow: visible;
}

@keyframes celebratePulse {
    0% { transform: scale(1); box-shadow: var(--shadow-lg), 0 0 0 0 rgba(168, 230, 207, 0.4); }
    15% { transform: scale(1.03); }
    30% { transform: scale(1); box-shadow: var(--shadow-lg), 0 0 60px 10px rgba(168, 230, 207, 0.3); }
    100% { transform: scale(1); box-shadow: var(--shadow-lg), 0 0 0 0 rgba(168, 230, 207, 0); }
}

/* Celebration ripple rings */
.streak-banner.complete.celebrating::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.6);
    transform: translate(-50%, -50%) scale(0);
    animation: rippleOut 1.5s ease-out;
    pointer-events: none;
}

@keyframes rippleOut {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(8); opacity: 0; }
}

/* Celebration: streak count bounce */
.streak-banner.complete.celebrating .streak-count {
    animation: countCelebrate 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes countCelebrate {
    0% { transform: scale(1); }
    25% { transform: scale(1.2) rotate(-3deg); }
    50% { transform: scale(1.3) rotate(3deg); }
    75% { transform: scale(1.1) rotate(-1deg); }
    100% { transform: scale(1) rotate(0); }
}

/* Floating celebration particles */
.celebration-particle {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    animation: floatUp 2.5s ease-out forwards;
    z-index: 10;
}

.celebration-particle.leaf {
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, var(--color-mint) 0%, var(--color-sage-light) 100%);
    border-radius: 50% 0 50% 0;
    transform: rotate(45deg);
}

.celebration-particle.circle {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.8);
}

.celebration-particle.dot {
    width: 6px;
    height: 6px;
    background: var(--color-coral-light);
}

.celebration-particle.spark {
    width: 4px;
    height: 10px;
    background: linear-gradient(to top, transparent, rgba(255, 255, 255, 0.9));
    border-radius: 2px;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(0deg) scale(1);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-150px) rotate(180deg) scale(0.5);
    }
}

/* Success message that appears */
.celebration-message {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-sage-dark);
    white-space: nowrap;
    opacity: 0;
    animation: messageAppear 2.5s ease-out forwards;
    z-index: 10;
}

@keyframes messageAppear {
    0% { opacity: 0; transform: translateX(-50%) translateY(10px); }
    20% { opacity: 1; transform: translateX(-50%) translateY(0); }
    80% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

.streak-count {
    font-family: var(--font-display);
    font-size: 5rem;
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 4px 20px rgba(0,0,0,0.15);
    animation: countPop 0.5s var(--transition-bounce);
}

@keyframes countPop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.streak-label {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 500;
    opacity: 0.95;
    margin-top: var(--space-sm);
    text-transform: lowercase;
    letter-spacing: 0.05em;
}

.streak-best {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: var(--space-sm);
}

/* Section Title */
.dashboard h2 {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    font-weight: 500;
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.dashboard h2::before {
    content: '';
    width: 4px;
    height: 1.25rem;
    background: var(--color-coral);
    border-radius: var(--radius-full);
}

/* ==========================================================================
   Exercise List (Dashboard)
   ========================================================================== */
.exercise-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.exercise-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    animation: slideIn 0.4s ease-out backwards;
}

.exercise-item:nth-child(1) { animation-delay: 0.1s; }
.exercise-item:nth-child(2) { animation-delay: 0.15s; }
.exercise-item:nth-child(3) { animation-delay: 0.2s; }
.exercise-item:nth-child(4) { animation-delay: 0.25s; }
.exercise-item:nth-child(5) { animation-delay: 0.3s; }

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

.exercise-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.exercise-item.completed {
    background: linear-gradient(135deg, rgba(168, 230, 207, 0.3) 0%, rgba(168, 230, 207, 0.1) 100%);
}

.exercise-item.completed .exercise-info h3 {
    color: var(--color-text-muted);
    text-decoration: line-through;
    text-decoration-color: var(--color-mint-dark);
    text-decoration-thickness: 2px;
}

.exercise-info {
    flex: 1;
    min-width: 0;
}

.exercise-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    color: var(--color-text);
}

.exercise-info p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Checkbox Toggle */
.toggle-form {
    flex-shrink: 0;
}

.checkbox {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid var(--color-cream-dark);
    background: var(--color-surface);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: transparent;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.checkbox::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--color-mint);
    border-radius: 50%;
    transform: scale(0);
    transition: transform var(--transition-bounce);
}

.checkbox:hover {
    border-color: var(--color-sage-light);
    transform: scale(1.05);
}

.checkbox.checked {
    border-color: var(--color-mint-dark);
    color: var(--color-white);
    animation: checkBounce 0.5s var(--transition-bounce);
}

.checkbox.checked::before {
    transform: scale(1);
}

@keyframes checkBounce {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* Checkmark */
.checkbox.checked::after {
    content: '✓';
    position: relative;
    z-index: 1;
    font-weight: 700;
}

/* Video Link */
.video-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-coral);
    color: var(--color-white);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
    flex-shrink: 0;
}

.video-link:hover {
    background: var(--color-coral-dark);
    color: var(--color-white);
    transform: scale(1.05);
}

.video-link::before {
    content: '▶';
    font-size: 0.7rem;
}

/* Dashboard Actions */
.dashboard-actions {
    text-align: center;
    padding-top: var(--space-md);
}

.manage-link {
    font-family: var(--font-display);
    font-weight: 500;
    color: var(--color-text-muted);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
}

.manage-link:hover {
    color: var(--color-primary);
    background: var(--color-cream);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-xl);
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: var(--space-lg);
}

/* ==========================================================================
   Exercises Manage Page
   ========================================================================== */
.exercises-page {
    animation: fadeInUp 0.6s ease-out;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
}

.page-header h2 {
    margin: 0;
    font-size: 1.75rem;
}

.exercises-manage-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.exercise-manage-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    animation: slideIn 0.4s ease-out backwards;
}

.exercise-manage-item:nth-child(1) { animation-delay: 0.05s; }
.exercise-manage-item:nth-child(2) { animation-delay: 0.1s; }
.exercise-manage-item:nth-child(3) { animation-delay: 0.15s; }
.exercise-manage-item:nth-child(4) { animation-delay: 0.2s; }
.exercise-manage-item:nth-child(5) { animation-delay: 0.25s; }

.exercise-manage-item:hover {
    box-shadow: var(--shadow-md);
}

.exercise-manage-item.inactive {
    opacity: 0.5;
}

.exercise-manage-item .exercise-info h3 {
    font-size: 1.1rem;
    margin-bottom: var(--space-xs);
}

.exercise-manage-item .exercise-info p {
    font-size: 0.9rem;
    margin: 0;
}

.inactive-badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-sm);
    background: var(--color-cream-dark);
    color: var(--color-text-muted);
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    margin-top: var(--space-xs);
}

.exercise-actions {
    display: flex;
    gap: var(--space-sm);
    flex-shrink: 0;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    background: linear-gradient(135deg, var(--color-sage) 0%, var(--color-sage-dark) 100%);
    color: var(--color-white);
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 15px rgba(124, 154, 130, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 154, 130, 0.4);
    color: var(--color-white);
}

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

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm) var(--space-md);
    background: var(--color-cream);
    color: var(--color-text);
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-secondary:hover {
    background: var(--color-cream-dark);
    color: var(--color-text);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm) var(--space-md);
    background: rgba(255, 181, 181, 0.3);
    color: #c0392b;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-danger:hover {
    background: var(--color-rose);
    color: #a93226;
}

.delete-form {
    display: inline;
}

/* ==========================================================================
   Forms
   ========================================================================== */
.exercise-form-page {
    max-width: 560px;
    margin: 0 auto;
    background: var(--color-surface);
    padding: var(--space-2xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    animation: fadeInUp 0.6s ease-out;
}

.exercise-form-page h2 {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-sm);
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--color-text);
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea {
    width: 100%;
    padding: var(--space-md);
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-text);
    background: var(--color-cream);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    background: var(--color-surface);
    border-color: var(--color-sage);
    box-shadow: 0 0 0 4px rgba(124, 154, 130, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--color-charcoal-light);
    opacity: 0.6;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    margin: 0;
}

.checkbox-group input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: var(--color-sage);
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: flex-end;
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-cream-dark);
}

/* ==========================================================================
   Login Page
   ========================================================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-sage-light) 0%, var(--color-sage) 50%, var(--color-sage-dark) 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 80%;
    height: 160%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.1) 0%, transparent 60%);
    pointer-events: none;
}

.login-page::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -30%;
    width: 80%;
    height: 120%;
    background: radial-gradient(ellipse, rgba(232, 168, 124, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: var(--space-lg);
    position: relative;
    z-index: 1;
}

.login-box {
    background: var(--color-surface);
    padding: var(--space-2xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: loginAppear 0.6s ease-out;
}

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

.login-box h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
    background: linear-gradient(135deg, var(--color-sage) 0%, var(--color-sage-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-box .tagline {
    color: var(--color-text-muted);
    margin-bottom: var(--space-xl);
    font-size: 1rem;
}

.login-box .form-group {
    text-align: left;
}

.login-box .btn-primary {
    width: 100%;
    padding: var(--space-md);
    margin-top: var(--space-md);
}

.error-message {
    background: rgba(255, 181, 181, 0.2);
    color: #c0392b;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    font-size: 0.9rem;
    border: 1px solid rgba(255, 181, 181, 0.4);
}

/* ==========================================================================
   History Page / Calendar
   ========================================================================== */
.history-page {
    animation: fadeInUp 0.6s ease-out;
}

.history-page h2 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: var(--space-xl);
}

.calendar {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: linear-gradient(135deg, var(--color-sage) 0%, var(--color-sage-dark) 100%);
}

.calendar-header span {
    padding: var(--space-md);
    text-align: center;
    color: var(--color-white);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.calendar-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    border: 1px solid var(--color-cream-dark);
    border-top: none;
    border-left: none;
    position: relative;
    transition: all var(--transition-base);
}

.calendar-day:first-child {
    border-left: none;
}

.calendar-day.other-month {
    opacity: 0.25;
}

.calendar-day.today {
    background: var(--color-cream);
}

.calendar-day.today .day-number {
    background: var(--color-coral);
    color: var(--color-white);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-day.completed {
    background: linear-gradient(135deg, rgba(168, 230, 207, 0.4) 0%, rgba(168, 230, 207, 0.2) 100%);
}

.calendar-day.completed.today {
    background: linear-gradient(135deg, rgba(168, 230, 207, 0.6) 0%, rgba(168, 230, 207, 0.4) 100%);
}

.day-number {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text);
}

.check-mark {
    color: var(--color-mint-dark);
    font-size: 1.1rem;
    font-weight: bold;
}

.legend {
    display: flex;
    justify-content: center;
    gap: var(--space-xl);
    padding: var(--space-lg);
    background: var(--color-cream);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-family: var(--font-display);
}

.legend-dot {
    width: 18px;
    height: 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-cream-dark);
}

.legend-dot.completed {
    background: linear-gradient(135deg, rgba(168, 230, 207, 0.6) 0%, rgba(168, 230, 207, 0.3) 100%);
}

.legend-dot.today {
    background: var(--color-cream-dark);
}

/* ==========================================================================
   Error Page
   ========================================================================== */
.error-page {
    text-align: center;
    padding: var(--space-3xl) var(--space-xl);
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    animation: fadeInUp 0.6s ease-out;
}

.error-page h2 {
    font-size: 4rem;
    color: var(--color-coral);
    margin-bottom: var(--space-md);
}

.error-page p {
    font-size: 1.2rem;
    margin-bottom: var(--space-xl);
}

.error-page a {
    color: var(--color-primary);
    font-weight: 600;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.status-ok {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    background: var(--color-mint);
    color: var(--color-sage-dark);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.8rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-warning {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    background: var(--color-coral-light);
    color: var(--color-coral-dark);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.8rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-error {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    background: var(--color-rose);
    color: #a93226;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.8rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 768px) {
    nav {
        padding: var(--space-md);
        flex-wrap: wrap;
        gap: var(--space-md);
    }

    nav h1 {
        font-size: 1.25rem;
    }

    nav ul {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .logout-btn {
        order: 2;
    }

    main {
        padding: var(--space-lg);
    }

    .streak-count {
        font-size: 4rem;
    }

    .streak-banner {
        padding: var(--space-xl) var(--space-lg);
    }

    .checkbox {
        width: 52px;
        height: 52px;
    }

    .exercise-item {
        flex-wrap: wrap;
    }

    .video-link {
        margin-left: 64px;
    }

    .exercise-manage-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .exercise-actions {
        width: 100%;
        justify-content: flex-start;
        margin-top: var(--space-md);
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-md);
    }

    .page-header .btn-primary {
        text-align: center;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn-secondary,
    .form-actions .btn-primary {
        width: 100%;
        justify-content: center;
    }

    .calendar-header span {
        padding: var(--space-sm);
        font-size: 0.75rem;
    }

    .legend {
        flex-direction: column;
        align-items: center;
        gap: var(--space-sm);
    }
}

@media (max-width: 480px) {
    .streak-count {
        font-size: 3rem;
    }

    .streak-label {
        font-size: 1rem;
    }

    .exercise-form-page {
        padding: var(--space-lg);
        border-radius: var(--radius-lg);
    }

    .login-box {
        padding: var(--space-xl);
    }

    .day-number {
        font-size: 0.85rem;
    }

    .check-mark {
        font-size: 0.9rem;
    }

    .calendar-day.today .day-number {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }
}

/* ==========================================================================
   HTMX - Disable animations on partial swap (except celebrations)
   ========================================================================== */
.no-animate,
.no-animate *:not(.celebrating):not(.celebration-particle):not(.celebration-message) {
    animation: none !important;
}

/* Re-enable celebration animations with higher specificity */
.no-animate .streak-banner.celebrating {
    animation: celebratePulse 2s ease-out !important;
}

.no-animate .streak-banner.celebrating::after {
    animation: rippleOut 1.5s ease-out !important;
}

.no-animate .streak-banner.celebrating .streak-count {
    animation: countCelebrate 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.no-animate .celebration-particle {
    animation: floatUp 2.5s ease-out forwards !important;
}

.no-animate .celebration-message {
    animation: messageAppear 2.5s ease-out forwards !important;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    body::before {
        display: none;
    }

    nav {
        display: none;
    }

    .streak-banner {
        box-shadow: none;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}
