/* Cal App — iCloud-inspired design */
:root {
    --bg-primary: #f5f5f7;
    --bg-card: #ffffff;
    --bg-gradient-start: #1a1a2e;
    --bg-gradient-mid: #16213e;
    --bg-gradient-end: #0f3460;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --text-light: #ffffff;
    --accent-blue: #007AFF;
    --accent-green: #34C759;
    --accent-red: #FF3B30;
    --accent-orange: #FF9500;
    --accent-purple: #AF52DE;
    --accent-teal: #5AC8FA;
    --border-light: rgba(0, 0, 0, 0.06);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --transition: all 0.2s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
}

/* ==================== LANDING PAGE ==================== */
.landing {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.landing-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        var(--bg-gradient-start) 0%, 
        var(--bg-gradient-mid) 50%, 
        var(--bg-gradient-end) 100%
    );
    z-index: 0;
}

.landing-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;
    background: radial-gradient(circle at 30% 50%, rgba(90, 200, 250, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 70% 30%, rgba(175, 82, 222, 0.1) 0%, transparent 50%);
    animation: bgFloat 20s ease-in-out infinite;
}

@keyframes bgFloat {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-2%, 2%); }
}

.landing-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

/* Logo */
.landing-hero {
    text-align: center;
    margin-bottom: 40px;
}

.landing-logo {
    margin-bottom: 20px;
}

.logo-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-teal));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 8px 32px rgba(0, 122, 255, 0.3);
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.logo-icon i {
    font-size: 36px;
    color: white;
}

.landing-title {
    font-size: 48px;
    font-weight: 700;
    color: var(--text-light);
    letter-spacing: -1px;
    margin-bottom: 8px;
}

.landing-subtitle {
    font-size: 18px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.5px;
}

/* Login card */
.landing-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-lg);
    animation: cardSlideUp 0.6s ease-out;
}

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

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 18px;
    z-index: 1;
}

.input-group input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    background: var(--bg-primary);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-family: inherit;
    color: var(--text-primary);
    transition: var(--transition);
    outline: none;
}

.input-group input:focus {
    border-color: var(--accent-blue);
    background: white;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

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

.btn-signin {
    width: 100%;
    padding: 16px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 17px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
}

.btn-signin:hover {
    background: #0056CC;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

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

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
    animation: alertSlide 0.3s ease-out;
}

@keyframes alertSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-error {
    background: #FEF2F2;
    color: #DC2626;
    border: 1px solid #FEE2E2;
}

.alert-info {
    background: #EFF6FF;
    color: #2563EB;
    border: 1px solid #DBEAFE;
}

/* Footer */
.landing-footer {
    text-align: center;
    margin-top: 32px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
}

/* ==================== DASHBOARD ==================== */
.dash-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.dash-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-teal));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-logo i {
    font-size: 18px;
    color: white;
}

.dash-header-left h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.dash-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

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

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.user-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
}

.user-role {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-parent {
    background: #DBEAFE;
    color: #2563EB;
}

.badge-kid {
    background: #FEF3C7;
    color: #D97706;
}

.badge-helper {
    background: #D1FAE5;
    color: #059669;
}

.btn-logout {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.btn-logout:hover {
    background: var(--bg-primary);
    color: var(--accent-red);
}

/* App grid */
.dash-main {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.app-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    animation: cardFadeIn 0.4s ease-out;
    animation-fill-mode: backwards;
}

.app-card:nth-child(1) { animation-delay: 0.1s; }
.app-card:nth-child(2) { animation-delay: 0.2s; }
.app-card:nth-child(3) { animation-delay: 0.3s; }
.app-card:nth-child(4) { animation-delay: 0.4s; }

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

.app-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

.app-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-icon i {
    font-size: 24px;
    color: white;
}

.app-info h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.app-info p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ==================== APP PLACEHOLDER ==================== */
.app-page {
    min-height: 100vh;
    background: var(--bg-primary);
}

.app-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header h1 {
    font-size: 18px;
    font-weight: 600;
}

.app-header-spacer {
    width: 60px;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: var(--transition);
}

.btn-back:hover {
    opacity: 0.7;
}

.app-main {
    max-width: 600px;
    margin: 0 auto;
    padding: 60px 24px;
}

.placeholder {
    text-align: center;
}

.placeholder-icon {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.placeholder-icon i {
    font-size: 36px;
    color: white;
}

.placeholder h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.placeholder p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.placeholder-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-card);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.btn-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    background: var(--accent-blue);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: var(--transition);
}

.btn-back-link:hover {
    background: #0056CC;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 480px) {
    .landing-title {
        font-size: 36px;
    }

    .landing-card {
        padding: 24px;
    }

    .dash-header {
        padding: 12px 16px;
    }

    .user-name {
        display: none;
    }

    .app-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .app-card {
        padding: 16px;
    }
}
