﻿@import url('https://fonts.googleapis.com/css2?family=Moderustic:wght@300..800&display=swap');

:root {
    --brand: #0059DC;
    --brand-dark: #110C55;
    --brand-light: #3373e0;
    --brand-pale: rgba(0, 89, 220, 0.08);
    --brand-glass: rgba(0, 89, 220, 0.18);
    --bg: #f0f4f8;
    --surface: #ffffff;
    --surface-2: #f7fafc;
    --border: #dde4eb;
    --text-primary: #292567;
    --text-secondary: #5a6577;
    --text-muted: #94a3b8;
    --red: #e05252;
    --green: #2bb67a;
    --radius: 15px;
    --radius-sm: 7px;
    --shadow: 0 6px 32px rgba(17, 12, 85, 0.10);
    --font-family: "Moderustic", sans-serif;
    --ease: 0.22s cubic-bezier(.4, 0, .2, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-size: 15px;
}

body {
    font-family: "Moderustic", sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ── Auth pages (login/register only — NOT report) ── */
.auth-wrap {
    /* FIX: was position:fixed which caused it to render over the sidebar.
       Now it flows normally inside .content-area on the report page.
       Login/register pages get their full-screen gradient via .login-page wrapper instead. */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    min-height: 100%;
    width: 100%;
}

/* Full-screen gradient only for the login / register shell */
.login-page .auth-wrap,
.auth-page .auth-wrap {
    position: fixed;
    inset: 0;
    z-index: 1;
    overflow-y: auto;
    background: #ffffff;
    min-height: unset;
    padding: 24px 16px;
}

/* ── Auth page logo (top-left, like Euroxx website navbar) ── */
.auth-logo {
    position: fixed;
    top: 0;
    left: 0;
    height: auto;
    width: auto;
    z-index: 10;
    display: block;
}

.auth-wrap .card {
    width: 100%;
    max-width: 480px;
    padding: 40px 44px;
    border-radius: var(--radius);
    background: var(--surface);
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    animation: cardIn 0.35s ease both;
    position: relative;
    overflow: visible;
}

    .auth-wrap .card::before {
        display: block;
    }

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Top navbar ── */
.top-navbar {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px 0 0;
    z-index: 200;
    border-bottom: none;
    box-shadow: none;
}

.navbar-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
    line-height: 0;
}

.navbar-logo {
    display: block;
    width: auto;
    height: auto;
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    margin: 0;
    width: auto;
    border: 1.5px solid #C0CCFC;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--brand-dark);
    font-family: "Moderustic", sans-serif;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--ease), border-color var(--ease), color var(--ease);
    letter-spacing: 0.2px;
}

    .btn-logout:hover {
        background: var(--brand-pale);
        border-color: var(--brand-dark);
        transform: none;
        box-shadow: none;
    }

    .btn-logout svg {
        flex-shrink: 0;
    }

/* ── Main content area ── */
.main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* ── Cards ── */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px 28px;
    max-width: 480px;
    width: 100%;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    animation: cardIn 0.35s ease both;
}

    .card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: var(--brand-dark);
        border-radius: var(--radius) var(--radius) 0 0;
    }

.card h3 {
    font-family: "Moderustic", sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--brand-dark);
    margin-bottom: 6px;
}

.card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

/* ── Inputs ── */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]) {
    width: 100%;
    padding: 11px 14px;
    margin-top: 11px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: "Moderustic", sans-serif;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--surface-2);
    outline: none;
    transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
}

input:focus {
    border-color: var(--brand);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(0, 89, 220, 0.12);
}

input::placeholder {
    color: var(--text-muted);
}

.password-wrapper {
    position: relative;
    width: 100%;
    margin-top: 11px;
}

    .password-wrapper input {
        margin-top: 0 !important;
        padding-right: 42px;
    }

.eye-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    opacity: 0.42;
    display: flex;
    align-items: center;
    transition: opacity var(--ease);
}

    .eye-toggle:hover {
        opacity: 1;
    }

    .eye-toggle img {
        height: 16px;
        width: 24px;
    }

/* ── Buttons ── */
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--brand-dark);
    color: #fff;
    font-family: "Moderustic", sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--ease), transform 0.12s, box-shadow var(--ease);
    letter-spacing: 0.2px;
}

    button:hover:not(:disabled) {
        background: #1a1570;
        box-shadow: 0 4px 18px rgba(17, 12, 85, 0.25);
        transform: translateY(-1px);
    }

    button:active:not(:disabled) {
        transform: translateY(0);
    }

    button:disabled {
        opacity: 0.52;
        cursor: not-allowed;
    }

.btn-ghost {
    background: transparent;
    color: var(--brand-dark);
    border: 1.5px solid #C0CCFC;
    margin-top: 0;
}

    .btn-ghost:hover:not(:disabled) {
        background: var(--brand-pale);
        border-color: var(--brand-dark);
        box-shadow: none;
        transform: none;
    }

/* ── Misc UI ── */
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 12px;
    color: var(--text-muted);
    font-size: 0.78rem;
}

    .divider::before, .divider::after {
        content: '';
        flex: 1;
        height: 1px;
        background: var(--border);
    }

.text-link {
    font-size: 0.82rem;
    color: #0059DC;
    font-weight: 500;
    cursor: pointer;
    transition: color var(--ease);
    text-decoration: none;
}

    .text-link:hover {
        color: #0046a3;
        text-decoration: underline;
    }

.link-row {
    display: flex;
    justify-content: space-between;
    margin-top: 14px;
    flex-wrap: wrap;
    gap: 6px;
}

.msg {
    margin-top: 13px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    font-weight: 500;
    animation: fadeIn 0.28s ease;
}

.msg-error {
    background: #fff0f0;
    color: var(--red);
    border-left: 3px solid var(--red);
}

.msg-success {
    background: #f0faf5;
    color: var(--green);
    border-left: 3px solid var(--green);
}

.msg-info {
    background: var(--brand-pale);
    color: #0059DC;
    border-left: 3px solid #0059DC;
}

.msg-warn {
    background: #fff8e6;
    color: #b8860b;
    border-left: 3px solid #daa520;
}

.otp-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--brand-pale);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 8px;
    font-size: 0.82rem;
    color: var(--brand-dark);
}

input.otp-field {
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 0.4em;
    font-weight: 600;
    color: var(--brand-dark);
}

.date-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
}

    .date-row input {
        flex: 1;
        min-width: 150px;
        margin-top: 0;
    }

    .date-row button {
        margin-top: 0;
        width: auto;
        padding: 11px 22px;
        flex-shrink: 0;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Blazor loading ── */
.loading-progress {
    position: relative;
    display: block;
    width: 7rem;
    height: 7rem;
    margin: 2rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #0059DC !important;
        stroke-width: 0.5rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: var(--border) !important;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    color: var(--brand);
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

/* ── Report page ── */
.report-wrap {
    display: flex;
    justify-content: center;
    padding: 24px 16px;
    min-width: 0;
}

.report-card {
    width: 100%;
    max-width: 1260px;
    padding: 28px 32px;
    border-radius: var(--radius);
    background: var(--surface);
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    animation: cardIn 0.35s ease both;
    position: relative;
    overflow: hidden;
}

    .report-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: var(--brand-dark);
        border-radius: var(--radius) var(--radius) 0 0;
    }

.pdf-preview-wrapper {
    margin-top: 22px;
    background: var(--surface-2);
    border-radius: var(--radius);
    padding: 12px;
    overflow: auto;
}

.pdf-preview-label {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.pdf-preview-frame {
    width: 100%;
    height: 80vh;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    overflow: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.page-title {
    font-family: "Moderustic", sans-serif;
    font-size: 1.55rem;
    margin-bottom: 5px;
}

.page-subtitle {
    font-size: 0.84rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .top-navbar {
        padding: 0 16px;
    }

    .navbar-logo-link {
        display: none;
    }

    .btn-logout {
        margin-left: auto;
    }

    .btn-logout span {
        display: none;
    }

    /* Auth pages */
    .auth-wrap {
        position: relative;
        min-height: 100vh;
        overflow-y: unset;
        align-items: flex-start;
        padding-top: 74px;
        background: #0059DC;
    }

    .auth-logo {
        display: none;
    }

        .auth-wrap .card {
            max-width: 100%;
            padding: 32px 24px;
        }

    .card {
        max-width: 100%;
        padding: 24px 20px;
    }

    .date-row {
        flex-direction: column;
        align-items: stretch;
    }

        .date-row input {
            min-width: unset;
        }

        .date-row button {
            width: 100% !important;
        }

    .report-card {
        width: 100%;
        padding: 28px 20px;
    }

    .pdf-preview-frame {
        height: 55vh;
    }
}

@media (max-width: 480px) {
    .auth-wrap .card {
        padding: 28px 18px;
    }

    .auth-wrap {
        padding: 16px 12px;
    }
}

@media (max-width: 1500px) {
    .report-card {
        width: 100%;
        padding: 28px 20px;
    }

    .pdf-preview-frame {
        height: 55vh;
    }
}
