/* ===================== VARIABILE / TEMĂ ===================== */

:root{
    --bg:#0e1015;
    --bg-soft:#11141b;
    --surface:#171b24;
    --surface-2:#1d2230;
    --text:#eef1f7;
    --muted:#98a2b6;
    --border:rgba(255,255,255,.10);
    --nav-bg:rgba(14,16,21,.82);
    --accent:#00d4ff;
    --accent-2:#7c5cff;
    --shadow:0 22px 50px rgba(0,0,0,.45);
    --radius:20px;
    --ok:#3ddc84;
    --err:#ff6b6b;
}

body.light-mode{
    --bg:#f3f6fc;
    --bg-soft:#e9eefa;
    --surface:#ffffff;
    --surface-2:#f4f7fd;
    --text:#151a24;
    --muted:#5a6478;
    --border:rgba(15,23,42,.12);
    --nav-bg:rgba(255,255,255,.85);
    --shadow:0 18px 40px rgba(15,23,42,.10);
    --ok:#1f7a4d;
    --err:#c02a2a;
}

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

html{
    scroll-behavior:smooth;
}

body{
    font-family:'Poppins',system-ui,-apple-system,'Segoe UI',sans-serif;
    background:
        radial-gradient(900px 500px at 50% -10%, rgba(0,212,255,.10), transparent 65%),
        var(--bg);
    color:var(--text);
    min-height:100vh;
    display:flex;
    flex-direction:column;
    line-height:1.65;
    -webkit-font-smoothing:antialiased;
    transition:background .4s ease, color .3s ease;
}

/* ===================== NAVIGARE ===================== */

header{
    position:sticky;
    top:0;
    z-index:50;
}

nav{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:12px clamp(16px,4vw,40px);
    background:var(--nav-bg);
    backdrop-filter:blur(14px);
    border-bottom:1px solid var(--border);
}

.logo{
    font-size:23px;
    font-weight:700;
    letter-spacing:-.02em;
    white-space:nowrap;
    background:linear-gradient(90deg,var(--accent),var(--accent-2));
    -webkit-background-clip:text;
    background-clip:text;
    color:transparent;
    padding-right:8px;
}

nav ul{
    list-style:none;
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:6px;
    row-gap:8px;
    margin:0;
    padding:0;
}

nav a{
    color:var(--muted);
    text-decoration:none;
    font-size:14.5px;
    font-weight:500;
    padding:8px 13px;
    border-radius:10px;
    transition:color .2s, background .2s;
}

nav a:hover{
    color:var(--text);
    background:var(--surface-2);
}

nav a.active{
    color:var(--accent);
    background:rgba(0,212,255,.12);
}

/* ===================== BUTOANE ===================== */

button{
    font-family:inherit;
    font-size:14.5px;
    font-weight:600;
    padding:11px 20px;
    border:none;
    border-radius:12px;
    cursor:pointer;
    color:#04121a;
    background:linear-gradient(135deg,var(--accent),#3fb9ff);
    box-shadow:0 8px 20px rgba(0,212,255,.22);
    transition:transform .2s, box-shadow .2s, opacity .2s, background .2s;
}

button:hover{
    transform:translateY(-2px);
    box-shadow:0 12px 26px rgba(0,212,255,.32);
}

button:active{
    transform:translateY(0);
}

button:disabled{
    opacity:.55;
    cursor:not-allowed;
    transform:none;
    box-shadow:none;
}

button.secondary{
    background:transparent;
    color:var(--text);
    border:1px solid var(--border);
    box-shadow:none;
    font-weight:500;
}

button.secondary:hover{
    color:var(--accent);
    border-color:var(--accent);
    background:transparent;
    box-shadow:none;
}

#themeBtn{
    width:40px;
    height:40px;
    padding:0;
    display:grid;
    place-items:center;
    font-size:17px;
    border-radius:50%;
    background:var(--surface-2);
    color:var(--text);
    border:1px solid var(--border);
    box-shadow:none;
}

#themeBtn:hover{
    box-shadow:none;
    border-color:var(--accent);
}

/* ===================== LAYOUT ===================== */

main{
    flex:1;
    width:100%;
    max-width:1120px;
    margin:0 auto;
    padding:clamp(20px,4vw,40px);
}

section{
    display:none;
    animation:fade .45s ease;
}

section.active{
    display:block;
}

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

/* ===================== HERO ===================== */

.hero{
    position:relative;
    overflow:hidden;
    text-align:center;
    padding:clamp(56px,9vw,104px) clamp(20px,4vw,40px);
    border-radius:28px;
    color:#fff;
    background:
        radial-gradient(120% 120% at 15% 0%, rgba(255,255,255,.28), transparent 45%),
        linear-gradient(135deg,#00d4ff 0%,#4f46e5 58%,#6a11cb 100%);
    box-shadow:0 28px 60px rgba(72,40,180,.32);
}

.hero h1{
    position:relative;
    font-size:clamp(34px,6vw,58px);
    line-height:1.1;
    letter-spacing:-.02em;
}

.hero p{
    position:relative;
    margin:16px auto 0;
    max-width:640px;
    font-size:clamp(16px,2vw,19px);
    font-weight:300;
    opacity:.95;
}

.hero button{
    position:relative;
    margin-top:30px;
    padding:13px 28px;
    background:#fff;
    color:#0b1220;
    box-shadow:0 14px 30px rgba(0,0,0,.22);
}

.hero button:hover{
    background:#f2f7ff;
    box-shadow:0 18px 36px rgba(0,0,0,.28);
}

/* ===================== CARD ===================== */

.card{
    margin-top:28px;
    padding:clamp(20px,3vw,34px);
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
}

/* ===================== CONȚINUT ===================== */

h1,h2,h3,h4{
    line-height:1.25;
    letter-spacing:-.01em;
}

#about h1{
    font-size:clamp(27px,4vw,38px);
    margin-bottom:18px;
}

h2{
    font-size:clamp(21px,3vw,27px);
    margin:6px 0 14px;
}

h3{
    font-size:18px;
    font-weight:600;
    margin:24px 0 10px;
}

h4{
    font-size:16px;
    font-weight:600;
    margin:18px 0 8px;
}

#about h2{
    margin-top:34px;
}

p{
    margin:12px 0;
}

#about p{
    color:var(--text);
    opacity:.92;
}

ul,ol{
    margin:10px 0 14px 22px;
    line-height:1.7;
}

li{
    margin:6px 0;
}

li ul,
li ol{
    margin-top:6px;
}

strong,b{
    font-weight:600;
}

em{
    font-style:italic;
}

hr{
    border:none;
    border-top:1px solid var(--border);
    margin:32px 0;
}

a{
    color:var(--accent);
}

code{
    font-family:'JetBrains Mono',ui-monospace,Consolas,monospace;
    font-size:.9em;
    padding:2px 7px;
    border-radius:7px;
    background:var(--surface-2);
    border:1px solid var(--border);
}

/* citat / comentariu */

.quote{
    margin:22px 0;
    padding:16px 20px;
    border-left:4px solid var(--accent);
    border-radius:14px;
    background:var(--surface-2);
    color:var(--muted);
}

.quote b{
    color:var(--text);
}

/* ===================== TABELE ===================== */

table{
    width:100%;
    border-collapse:separate;
    border-spacing:0;
    margin:20px 0;
    border:1px solid var(--border);
    border-radius:14px;
    overflow:hidden;
    background:var(--surface-2);
}

th,td{
    padding:12px 16px;
    text-align:left;
    vertical-align:top;
    border-bottom:1px solid var(--border);
}

tr:last-child td{
    border-bottom:none;
}

th{
    font-size:12.5px;
    font-weight:600;
    letter-spacing:.09em;
    text-transform:uppercase;
    color:var(--accent);
    background:rgba(0,212,255,.10);
}

td pre{
    margin:0;
}

/* ===================== COD ===================== */

pre{
    margin:16px 0;
    padding:18px;
    border-radius:14px;
    border:1px solid rgba(255,255,255,.07);
    background:#0a0e15;
    color:#e6edf6;
    font-family:'JetBrains Mono',ui-monospace,Consolas,monospace;
    font-size:13px;
    line-height:1.65;
    overflow:auto;
    tab-size:4;
}

pre code{
    background:none;
    border:none;
    padding:0;
    color:inherit;
    font-size:inherit;
}

/* ===================== SUBSOL ===================== */

footer{
    margin-top:44px;
    border-top:1px solid var(--border);
    background:var(--bg-soft);
    scroll-margin-bottom:40px;
}

.footer-inner{
    max-width:1120px;
    margin:0 auto;
    padding:26px clamp(20px,4vw,40px);
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    justify-content:space-between;
    gap:8px 24px;
    color:var(--muted);
    font-size:14px;
}

.footer-inner h3{
    margin:0;
    font-size:16px;
    color:var(--text);
}

.footer-inner p{
    margin:0;
}

.footer-inner a{
    color:var(--accent);
    text-decoration:none;
}

.footer-inner a:hover{
    text-decoration:underline;
}

/* ===================== AUTENTIFICARE ===================== */

#authNav{
    display:flex;
    align-items:center;
    gap:10px;
}

.user-chip{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:4px 13px 4px 4px;
    border-radius:999px;
    background:var(--surface-2);
    border:1px solid var(--border);
    font-size:14px;
    font-weight:500;
    white-space:nowrap;
}

.avatar{
    display:grid;
    place-items:center;
    width:27px;
    height:27px;
    border-radius:50%;
    background:linear-gradient(135deg,var(--accent),var(--accent-2));
    color:#04121a;
    font-size:13px;
    font-weight:700;
}

.modal{
    display:none;
    position:fixed;
    inset:0;
    z-index:100;
    padding:20px;
    background:rgba(6,9,15,.70);
    backdrop-filter:blur(6px);
    justify-content:center;
    align-items:center;
}

.modal.open{
    display:flex;
}

.modal-content{
    position:relative;
    width:min(420px,100%);
    max-height:calc(100vh - 40px);
    overflow:auto;
    padding:30px;
    border-radius:24px;
    border:1px solid var(--border);
    background:var(--surface);
    color:var(--text);
    box-shadow:0 30px 80px rgba(0,0,0,.55);
    animation:pop .25s cubic-bezier(.2,.9,.3,1.15);
}

@keyframes pop{
    from{
        opacity:0;
        transform:translateY(18px) scale(.97);
    }
    to{
        opacity:1;
        transform:translateY(0) scale(1);
    }
}

.modal-content h2{
    margin:0;
    font-size:23px;
}

.auth-sub{
    margin:6px 0 0;
    font-size:14px;
    color:var(--muted);
}

.close{
    position:absolute;
    top:16px;
    right:16px;
    width:34px;
    height:34px;
    padding:0;
    display:grid;
    place-items:center;
    border-radius:50%;
    font-size:20px;
    line-height:1;
    font-weight:400;
    background:var(--surface-2);
    color:var(--muted);
    border:1px solid var(--border);
    box-shadow:none;
}

.close:hover{
    color:var(--text);
    border-color:var(--accent);
    background:var(--surface-2);
    box-shadow:none;
    transform:none;
}

.auth-tabs{
    display:flex;
    gap:6px;
    margin:20px 0 14px;
    padding:5px;
    border-radius:14px;
    background:var(--surface-2);
    border:1px solid var(--border);
}

.auth-tab{
    flex:1;
    padding:9px 10px;
    font-size:14px;
    font-weight:500;
    border-radius:10px;
    background:transparent;
    color:var(--muted);
    box-shadow:none;
}

.auth-tab:hover{
    color:var(--text);
    background:transparent;
    box-shadow:none;
    transform:none;
}

.auth-tab.active{
    color:var(--text);
    background:var(--surface);
    box-shadow:0 4px 14px rgba(0,0,0,.18);
}

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

.auth-form label{
    margin-top:6px;
    font-size:12.5px;
    font-weight:500;
    color:var(--muted);
}

.auth-form input{
    font-family:inherit;
    font-size:15px;
    padding:12px 14px;
    border-radius:12px;
    border:1px solid var(--border);
    background:var(--surface-2);
    color:var(--text);
    outline:none;
    transition:border-color .2s, box-shadow .2s, background .2s;
}

.auth-form input::placeholder{
    color:var(--muted);
    opacity:.7;
}

.auth-form input:focus{
    border-color:var(--accent);
    background:var(--surface);
    box-shadow:0 0 0 4px rgba(0,212,255,.16);
}

.auth-form .primary{
    margin-top:16px;
    width:100%;
    padding:13px;
    font-size:15px;
}

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

.auth-msg{
    font-size:13.5px;
    line-height:1.45;
    border-radius:12px;
}

.auth-msg:empty{
    display:none;
}

.auth-msg.error{
    padding:10px 13px;
    color:var(--err);
    background:rgba(255,107,107,.10);
    border:1px solid rgba(255,107,107,.30);
}

.auth-msg.success{
    padding:10px 13px;
    color:var(--ok);
    background:rgba(61,220,132,.10);
    border:1px solid rgba(61,220,132,.30);
}

body.light-mode .auth-msg.error{
    background:#fdecec;
    border-color:#f3b7b7;
}

.hidden{
    display:none !important;
}

/* ===================== NOTIFICARE ===================== */

.toast{
    position:fixed;
    left:50%;
    bottom:26px;
    z-index:200;
    max-width:calc(100% - 40px);
    padding:13px 20px;
    border-radius:14px;
    border:1px solid var(--border);
    border-left:4px solid var(--accent);
    background:var(--surface);
    color:var(--text);
    font-size:14px;
    box-shadow:var(--shadow);
    opacity:0;
    pointer-events:none;
    transform:translate(-50%,18px);
    transition:opacity .3s ease, transform .3s ease;
}

.toast.show{
    opacity:1;
    transform:translate(-50%,0);
}

.toast.error{
    border-left-color:var(--err);
}

/* ===================== RESPONSIVE ===================== */

@media(max-width:1000px){

    .logo{
        font-size:21px;
    }

    nav ul{
        gap:2px;
    }

    nav a{
        padding:8px 10px;
        font-size:14px;
    }
}

@media(max-width:860px){

    .logo{
        font-size:19px;
    }

    nav a{
        padding:7px 9px;
        font-size:13.5px;
    }

    #themeBtn{
        width:36px;
        height:36px;
        font-size:16px;
    }

    #authNav{
        gap:8px;
    }

    #authNav button{
        font-size:13px;
        padding:9px 14px;
    }

    .user-chip{
        font-size:13px;
        padding:3px 10px 3px 3px;
    }

    .avatar{
        width:24px;
        height:24px;
        font-size:12px;
    }
}

@media(max-width:768px){

    nav{
        flex-direction:column;
        align-items:flex-start;
        gap:10px;
    }

    nav ul{
        width:100%;
        justify-content:flex-start;
        gap:4px;
    }

    .hero{
        border-radius:22px;
    }

    .card{
        padding:18px;
    }

    .footer-inner{
        flex-direction:column;
        align-items:flex-start;
    }

    table{
        display:block;
        overflow-x:auto;
    }
}

@media (prefers-reduced-motion:reduce){

    *{
        animation:none !important;
        transition:none !important;
    }

    html{
        scroll-behavior:auto;
    }
}
