/* =====================================================
   PIYETO APP - MAIN STYLESHEET
   Modern SaaS UI | Yellow Gradient
===================================================== */

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

:root {
    --primary: #fbbf24;
    --primary-dark: #f59e0b;
    --primary-light: #fef3c7;
    --navy: #0f172a;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e2e8f0;
    --background: #f8fafc;
    --white: #ffffff;
    --danger: #dc2626;
    --success: #16a34a;
    --radius: 16px;
    --shadow: 0 15px 45px rgba(15, 23, 42, .08);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background: var(--background);
    font-size: 14px;
    line-height: 1.6;
}

button,
input,
textarea,
select {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    cursor: pointer;
}

/* =====================================================
   AUTHENTICATION BACKGROUND
===================================================== */

.auth-wrapper {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    position: relative;
    overflow: hidden;

    background:
        radial-gradient(
            circle at 10% 10%,
            rgba(251, 191, 36, .24),
            transparent 35%
        ),
        radial-gradient(
            circle at 90% 90%,
            rgba(245, 158, 11, .18),
            transparent 35%
        ),
        linear-gradient(135deg, #fffdf5, #fff7e6, #ffffff);
}

.auth-wrapper::before {
    content: "";
    position: absolute;
    width: 350px;
    height: 350px;
    top: -150px;
    right: -100px;
    border-radius: 50%;
    background: rgba(251, 191, 36, .13);
    filter: blur(5px);
    pointer-events: none;
}

.auth-wrapper::after {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    bottom: -130px;
    left: -80px;
    border-radius: 50%;
    background: rgba(245, 158, 11, .12);
    filter: blur(5px);
    pointer-events: none;
}

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

.auth-card {
    width: 100%;
    max-width: 460px;
    position: relative;
    z-index: 1;
    padding: 42px;
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 24px;
    box-shadow: 0 25px 70px rgba(15, 23, 42, .10);
    backdrop-filter: blur(15px);
    animation: authAppear .5s ease;
}

@keyframes authAppear {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =====================================================
   BRAND
===================================================== */

.brand {
    display: inline-flex;
    align-items: center;
    margin-bottom: 30px;
    color: var(--navy);
    font-size: 34px;
    font-weight: 900;
    letter-spacing: -2px;
    line-height: 1;
}

.brand span {
    color: var(--primary-dark);
}

/* =====================================================
   AUTH TITLE
===================================================== */

.auth-card h1 {
    color: var(--navy);
    font-size: 27px;
    line-height: 1.3;
    font-weight: 800;
    letter-spacing: -.8px;
    margin-bottom: 9px;
}

.auth-card .subtitle {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 27px;
}

/* =====================================================
   FORM
===================================================== */

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

.auth-card label {
    display: block;
    margin-top: 8px;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.auth-card input {
    width: 100%;
    height: 49px;
    padding: 0 15px;
    color: var(--navy);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 11px;
    outline: none;
    font-size: 13px;
    transition: .2s ease;
}

.auth-card input::placeholder {
    color: #a0a9b8;
}

.auth-card input:hover {
    border-color: #cbd5e1;
}

.auth-card input:focus {
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 4px rgba(251, 191, 36, .15);
}

/* =====================================================
   PRIMARY BUTTON
===================================================== */

.btn-primary {
    min-height: 49px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 9px;
    padding: 12px 22px;
    border: none;
    border-radius: 11px;

    background: linear-gradient(
        110deg,
        #fcd34d,
        #fbbf24,
        #f59e0b
    );

    color: #422006;
    font-size: 14px;
    font-weight: 800;

    box-shadow: 0 7px 18px rgba(245, 158, 11, .20);
    transition: all .25s ease;
}

.auth-card .btn-primary {
    width: 100%;
    margin-top: 17px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 11px 24px rgba(245, 158, 11, .28);
}

.btn-primary:active {
    transform: scale(.98);
}

/* =====================================================
   AUTH FOOTER
===================================================== */

.auth-footer {
    margin-top: 22px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
    line-height: 1.8;
}

.auth-footer a {
    color: #d97706;
    font-weight: 800;
}

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

/* =====================================================
   ALERT
===================================================== */

.alert {
    padding: 13px 15px;
    margin-bottom: 18px;
    border-radius: 11px;
    font-size: 13px;
    line-height: 1.6;
}

.alert.error {
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.alert.success {
    color: #15803d;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

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

.dashboard-layout {
    min-height: 100vh;
    display: flex;
    background: #f8fafc;
}

/* SIDEBAR */

.sidebar {
    width: 255px;
    min-width: 255px;
    display: flex;
    flex-direction: column;
    padding: 28px 18px;
    background: #fff;
    border-right: 1px solid var(--border);
}

.sidebar .brand {
    margin: 0 0 42px 10px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    padding: 13px 15px;
    border-radius: 11px;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    transition: .2s;
}

.sidebar nav a:hover {
    background: #fffbeb;
    color: #92400e;
}

.sidebar nav a.active {
    background: linear-gradient(110deg, #fef3c7, #fde68a);
    color: #78350f;
    font-weight: 800;
}

/* LOGOUT */

.logout-form {
    margin-top: auto;
}

.logout-button {
    width: 100%;
    min-height: 44px;
    padding: 10px;
    border: 1px solid #fee2e2;
    border-radius: 10px;
    background: #fff;
    color: #dc2626;
    font-size: 13px;
    font-weight: 700;
    transition: .2s;
}

.logout-button:hover {
    background: #fef2f2;
}

/* =====================================================
   DASHBOARD MAIN
===================================================== */

.dashboard-main {
    flex: 1;
    min-width: 0;
    padding: 38px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
}

.dashboard-header h1 {
    color: var(--navy);
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -1px;
}

.dashboard-header .subtitle {
    color: var(--muted);
    margin-top: 5px;
}

.eyebrow {
    color: #b45309;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.7px;
}

.user-avatar {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: linear-gradient(135deg, #fde68a, #f59e0b);
    color: #422006;
    font-size: 20px;
    font-weight: 900;
}

/* =====================================================
   DASHBOARD STATS
===================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 25px;
}

.stat-card {
    padding: 23px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    transition: .2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.stat-card strong {
    display: block;
    margin: 13px 0 7px;
    color: var(--navy);
    font-size: 25px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.stat-card small {
    color: #94a3b8;
    font-size: 11px;
}

/* =====================================================
   WELCOME PANEL
===================================================== */

.welcome-panel {
    position: relative;
    overflow: hidden;
    padding: 38px;
    border-radius: 20px;

    background:
        radial-gradient(
            circle at 90% 20%,
            rgba(255, 255, 255, .55),
            transparent 30%
        ),
        linear-gradient(120deg, #fef3c7, #fde68a, #fed7aa);
}

.welcome-panel h2 {
    max-width: 550px;
    margin: 12px 0;
    color: #422006;
    font-size: 29px;
    font-weight: 900;
    letter-spacing: -1px;
    line-height: 1.3;
}

.welcome-panel p:not(.eyebrow) {
    max-width: 540px;
    margin-bottom: 23px;
    color: #57534e;
    line-height: 1.8;
    font-size: 13px;
}

.button-link {
    width: fit-content;
}

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

.card {
    padding: 24px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 5px 20px rgba(15, 23, 42, .03);
}

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

@media (max-width: 900px) {

    .sidebar {
        width: 220px;
        min-width: 220px;
    }

    .dashboard-main {
        padding: 25px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

@media (max-width: 650px) {

    .auth-wrapper {
        padding: 22px 14px;
    }

    .auth-card {
        max-width: 440px;
        padding: 29px 22px;
        border-radius: 19px;
    }

    .auth-card h1 {
        font-size: 24px;
    }

    .brand {
        font-size: 31px;
    }

    .dashboard-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-width: 0;
        padding: 15px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .sidebar .brand {
        margin: 0 0 15px 5px;
    }

    .sidebar nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 5px;
    }

    .sidebar nav a {
        flex-shrink: 0;
        padding: 11px 13px;
        white-space: nowrap;
    }

    .logout-form {
        margin-top: 12px;
    }

    .dashboard-main {
        padding: 23px 16px;
    }

    .dashboard-header h1 {
        font-size: 25px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .welcome-panel {
        padding: 25px 22px;
    }

    .welcome-panel h2 {
        font-size: 23px;
    }
}

/* =====================================================
   SMALL MOBILE
===================================================== */

@media (max-width: 380px) {

    .auth-card {
        padding: 25px 17px;
    }

    .auth-card h1 {
        font-size: 22px;
    }

    .auth-card input {
        height: 46px;
    }

    .dashboard-main {
        padding: 18px 12px;
    }
}
