@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@200;400;700&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #07090f;
    font-family: 'Inter', sans-serif;
    color: #ffffff;
    overflow: hidden;
    position: relative;
}

/* ── Ambient Blobs ── */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 15s infinite alternate ease-in-out;
    z-index: 1;
}
.blob-1 { width:300px;height:300px;background:#3b82f6;top:-50px;left:20%; }
.blob-2 { width:400px;height:400px;background:#8b5cf6;bottom:-100px;right:15%;animation-delay:-5s; }
.blob-3 { width:250px;height:250px;background:#10b981;top:40%;left:-50px;animation-delay:-10s;opacity:0.4; }
@keyframes float {
    0%   { transform: translate(0,0) scale(1); }
    100% { transform: translate(30px,50px) scale(1.1); }
}

/* ── Glass Panel (shared) ── */
.glass {
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,0.15);
    border-top: 1px solid rgba(255,255,255,0.3);
    border-left: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 30px 60px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.1);
    border-radius: 30px;
}

/* ══════════════════════════════
   AUTH OVERLAY
══════════════════════════════ */
#auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(7,9,15,0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: opacity 0.4s ease;
}
#auth-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.auth-card {
    width: 380px;
    padding: 44px 36px 36px;
    text-align: center;
    position: relative;
    z-index: 10;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.auth-card:hover { transform: translateY(-4px); }

.auth-logo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.auth-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 400;
    background: linear-gradient(to bottom, #ffffff, #a1a1aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 6px;
}

.auth-subtitle {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.4);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 32px;
}

/* Tabs */
.auth-tabs {
    display: flex;
    gap: 0;
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 4px;
    margin-bottom: 28px;
}
.auth-tab {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: rgba(255,255,255,0.4);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.25s ease;
}
.auth-tab.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

/* Input group */
.input-group {
    position: relative;
    margin-bottom: 14px;
}
.input-group input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    color: #fff;
    font-size: 0.88rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.25s ease;
}
.input-group input::placeholder { color: rgba(255,255,255,0.25); }
.input-group input:focus {
    border-color: rgba(99,102,241,0.6);
    background: rgba(99,102,241,0.06);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

/* Primary auth button */
.auth-btn-primary {
    width: 100%;
    padding: 15px;
    margin-top: 6px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.auth-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99,102,241,0.4);
}
.auth-btn-primary:active { transform: scale(0.97); }
.auth-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: rgba(255,255,255,0.2);
    font-size: 0.75rem;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.08);
}

/* Google button */
.auth-btn-google {
    width: 100%;
    padding: 13px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.8);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.25s ease;
}
.auth-btn-google:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.2);
    color: #fff;
}

/* Error / info messages */
.auth-message {
    margin-top: 14px;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 0.78rem;
    display: none;
    text-align: left;
    line-height: 1.5;
}
.auth-message.error {
    display: block;
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.25);
    color: #fca5a5;
}
.auth-message.success {
    display: block;
    background: rgba(16,185,129,0.12);
    border: 1px solid rgba(16,185,129,0.25);
    color: #6ee7b7;
}

/* Spinner */
.spinner {
    display: none;
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto;
}
.auth-btn-primary.loading .btn-text { display: none; }
.auth-btn-primary.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════
   MAIN APP (Focus Timer)
══════════════════════════════ */
#app {
    position: relative;
    z-index: 10;
    width: 400px;
    padding: 50px 40px 30px;
    text-align: center;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#app:hover { transform: translateY(-5px); }

/* User bar */
.user-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    padding: 0 2px;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}
.user-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}
.user-email {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.35);
    letter-spacing: 0.5px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sync-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.65rem;
    color: rgba(255,255,255,0.25);
    letter-spacing: 1px;
}
.sync-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
    animation: pulse 2s infinite;
}
.sync-dot.syncing {
    background: #f59e0b;
    box-shadow: 0 0 6px #f59e0b;
    animation: spin 0.7s linear infinite;
    border-radius: 0;
    clip-path: polygon(50% 0%,100% 25%,100% 75%,50% 100%,0% 75%,0% 25%);
}
@keyframes pulse {
    0%,100% { opacity:1; }
    50%      { opacity:0.3; }
}

h1 {
    font-weight: 500;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 20px;
}

#timer {
    font-family: 'Outfit', sans-serif;
    font-size: 80px;
    font-weight: 200;
    line-height: 1;
    margin-bottom: 40px;
    letter-spacing: -2px;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 10px 30px rgba(255,255,255,0.1);
    background: linear-gradient(to bottom, #ffffff, #a1a1aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.buttons {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 40px;
}

button.ctrl {
    flex: 1;
    padding: 16px 0;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}
button.ctrl.start:hover  { background:rgba(16,185,129,0.2);border-color:rgba(16,185,129,0.5);color:#fff;box-shadow:0 0 20px rgba(16,185,129,0.3); }
button.ctrl.pause:hover  { background:rgba(245,158,11,0.2);border-color:rgba(245,158,11,0.5);color:#fff;box-shadow:0 0 20px rgba(245,158,11,0.3); }
button.ctrl.reset:hover  { background:rgba(239,68,68,0.2);border-color:rgba(239,68,68,0.5);color:#fff;box-shadow:0 0 20px rgba(239,68,68,0.3); }
button.ctrl:active { transform: scale(0.92); }

.stats-container {
    padding-top: 25px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.stat-box { text-align: left; }
.stat-box.right { text-align: right; }
.stat-label {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 6px;
}
.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}
#total-stats  { color: #60a5fa; }
#session-stats { color: #f472b6; text-shadow: 0 0 10px rgba(244,114,182,0.3); }

.wipe-stats-btn {
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    color: rgba(255,255,255,0.2);
    font-size: 0.6rem;
    letter-spacing: 2px;
    padding: 8px;
    border-radius: 8px;
    width: 100%;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.2s ease;
}
.wipe-stats-btn:hover {
    background: rgba(239,68,68,0.1);
    color: #f87171;
}

/* Sign-out link */
.signout-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.18);
    font-size: 0.6rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: color 0.2s ease;
}
.signout-btn:hover { color: rgba(239,68,68,0.7); }

/* ══ Config notice ══ */
#config-notice {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    background: rgba(251,191,36,0.12);
    border: 1px solid rgba(251,191,36,0.3);
    border-radius: 14px;
    padding: 14px 20px;
    font-size: 0.78rem;
    color: #fcd34d;
    max-width: 420px;
    width: calc(100% - 40px);
    text-align: center;
    line-height: 1.6;
    display: none;
}
#config-notice.visible { display: block; }
#config-notice code {
    background: rgba(255,255,255,0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.82em;
}
