@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');

:root {
    --forest-950: #041d1a;
    --forest-900: #072f2a;
    --forest-800: #0a463d;
    --emerald-500: #18b884;
    --emerald-400: #33d6a0;
    --mint-100: #dff8ee;
    --ink: #10251f;
    --muted: #667b74;
    --line: #dce8e3;
    --surface: #ffffff;
    --danger: #bd2c3c;
    --shadow: 0 24px 80px rgba(3, 31, 25, .18);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--forest-950); }

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    font-family: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
a { color: inherit; }

.auth-page {
    background:
        radial-gradient(circle at 5% 5%, rgba(51, 214, 160, .22), transparent 34rem),
        radial-gradient(circle at 92% 92%, rgba(24, 184, 132, .18), transparent 32rem),
        linear-gradient(145deg, var(--forest-950), var(--forest-900));
}

.auth-page::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .13;
    background-image: linear-gradient(rgba(255,255,255,.1) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.1) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, black, transparent 80%);
}

.auth-shell {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
}

.auth-card {
    width: min(100%, 460px);
    padding: 40px;
    border: 1px solid rgba(255,255,255,.65);
    border-radius: 30px;
    background: rgba(255,255,255,.97);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.brand-mark {
    display: grid;
    width: 56px;
    height: 56px;
    margin-bottom: 26px;
    place-items: center;
    border-radius: 18px;
    color: white;
    background: linear-gradient(145deg, var(--emerald-400), var(--forest-800));
    box-shadow: 0 12px 24px rgba(24,184,132,.25);
    font: 800 27px/1 'Manrope', sans-serif;
}

.eyebrow {
    margin: 0 0 7px;
    color: #12805e;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .15em;
    text-transform: uppercase;
}

h1, h2 { font-family: 'Manrope', sans-serif; }

.auth-card h1 {
    margin: 0;
    font-size: clamp(2rem, 8vw, 2.7rem);
    line-height: 1.05;
    letter-spacing: -.045em;
}

.subtitle { margin: 10px 0 29px; color: var(--muted); }

.auth-form { display: grid; gap: 10px; }
.auth-form label { margin-top: 7px; font-size: .88rem; font-weight: 700; }

.auth-form input {
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    outline: none;
    color: var(--ink);
    background: #f9fcfb;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.auth-form input:focus {
    border-color: var(--emerald-500);
    background: white;
    box-shadow: 0 0 0 4px rgba(24,184,132,.12);
}

.password-field { position: relative; }
.password-field input { padding-right: 88px; }
.show-password {
    position: absolute;
    top: 50%;
    right: 13px;
    padding: 7px;
    border: 0;
    color: #13785a;
    background: transparent;
    cursor: pointer;
    font-size: .76rem;
    font-weight: 700;
}

.primary-button {
    min-height: 54px;
    margin-top: 12px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 0;
    border-radius: 15px;
    color: white;
    background: linear-gradient(135deg, var(--forest-800), var(--emerald-500));
    box-shadow: 0 12px 25px rgba(8, 84, 67, .2);
    cursor: pointer;
    font-weight: 800;
    text-decoration: none;
    transition: transform .2s, box-shadow .2s, opacity .2s;
}

.primary-button:hover { transform: translateY(-2px); box-shadow: 0 16px 30px rgba(8,84,67,.27); }
.primary-button:disabled { cursor: wait; opacity: .65; transform: none; }

.separator { display: flex; align-items: center; gap: 14px; margin: 25px 0 19px; color: #91a19c; font-size: .8rem; }
.separator::before, .separator::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.google-wrap { min-height: 44px; display: flex; justify-content: center; overflow: hidden; }
.auth-switch { margin: 24px 0 0; text-align: center; color: var(--muted); font-size: .9rem; }
.auth-switch a, .back-link { color: #087a57; font-weight: 800; text-underline-offset: 3px; }
.back-link { display: inline-block; margin-bottom: 22px; font-size: .86rem; text-decoration: none; }

.message { margin: -9px 0 18px; padding: 12px 14px; border-radius: 12px; background: #fff0f1; color: var(--danger); font-size: .88rem; font-weight: 600; }
.message.success { background: #e4f8f0; color: #087052; }

.dashboard-page, .app-page { background: #f3f8f6; }

.topbar {
    min-height: 74px;
    padding: 0 max(20px, calc((100vw - 1180px) / 2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    color: white;
    background: var(--forest-950);
}

.topbar-brand { display: flex; align-items: center; gap: 10px; font: 800 1.05rem/1 'Manrope', sans-serif; text-decoration: none; }
.topbar-brand span { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: var(--emerald-500); }
.logout-button, .dashboard-link { border: 1px solid rgba(255,255,255,.2); border-radius: 999px; padding: 9px 14px; color: white; background: rgba(255,255,255,.07); cursor: pointer; text-decoration: none; font-size: .8rem; font-weight: 700; }

.dashboard-shell { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 62px 0 80px; }
.welcome { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 38px; }
.welcome h1 { margin: 0; font-size: clamp(2rem, 7vw, 3.6rem); line-height: 1.04; letter-spacing: -.05em; }
.welcome p:last-child { margin: 12px 0 0; color: var(--muted); }
.avatar { width: 68px; height: 68px; object-fit: cover; border: 4px solid white; border-radius: 22px; box-shadow: 0 10px 28px rgba(4,29,26,.13); }
.avatar-fallback { display: grid; flex: 0 0 auto; place-items: center; color: white; background: linear-gradient(145deg, var(--emerald-400), var(--forest-800)); font: 800 1.6rem 'Manrope', sans-serif; }

.app-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.app-card {
    min-height: 285px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid #e1ebe7;
    border-radius: 24px;
    color: var(--ink);
    background: white;
    box-shadow: 0 8px 30px rgba(9,57,47,.055);
    text-decoration: none;
    transition: transform .25s, border-color .25s, box-shadow .25s;
}
.app-card:hover { transform: translateY(-5px); border-color: rgba(24,184,132,.45); box-shadow: 0 18px 38px rgba(9,57,47,.11); }
.app-card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.app-icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 15px; color: var(--forest-800); background: var(--mint-100); font-size: 1.45rem; }
.app-number { color: #a6b5b0; font: 700 .78rem 'Manrope', sans-serif; letter-spacing: .12em; }
.app-card h2 { margin: 24px 0 7px; font-size: 1.35rem; letter-spacing: -.025em; }
.app-card p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.launch { color: #0b7d5c; font-size: .86rem; font-weight: 800; }
.launch b { margin-left: 5px; }

.placeholder-shell { width: min(680px, calc(100% - 36px)); margin: 0 auto; padding: 14vh 0 80px; text-align: center; }
.placeholder-icon { display: grid; width: 86px; height: 86px; margin: 0 auto 28px; place-items: center; border-radius: 28px; color: white; background: linear-gradient(145deg, var(--emerald-400), var(--forest-800)); box-shadow: 0 20px 40px rgba(24,184,132,.22); font: 800 1.5rem 'Manrope', sans-serif; }
.placeholder-shell h1 { margin: 0; font-size: clamp(2.3rem, 9vw, 4.3rem); letter-spacing: -.055em; }
.placeholder-shell > p:not(.eyebrow) { margin: 18px auto 30px; max-width: 560px; color: var(--muted); line-height: 1.65; }
.inline-button { width: fit-content; min-width: 190px; margin: 0 auto; justify-content: center; }

@media (max-width: 820px) {
    .app-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
    .auth-card { padding: 28px 22px; border-radius: 24px; }
    .brand-mark { width: 50px; height: 50px; margin-bottom: 22px; border-radius: 15px; }
    .dashboard-shell { width: min(100% - 28px, 1180px); padding-top: 40px; }
    .topbar { min-height: 66px; padding: 0 14px; }
    .topbar-brand { font-size: .95rem; }
    .dashboard-link { max-width: 142px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
    .welcome { align-items: flex-start; }
    .avatar { width: 54px; height: 54px; border-radius: 17px; }
    .app-grid { grid-template-columns: 1fr; gap: 13px; }
    .app-card { min-height: 235px; padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

