@import url('https://fonts.googleapis.com/css2?family=Sora:wght@500;600;700;800&family=Source+Sans+3:wght@400;500;600;700&display=swap');

:root {
    --ink-900: #0b2135;
    --ink-700: #23425d;
    --text-900: #10263a;
    --text-700: #456077;
    --text-500: #6a8497;
    --surface-100: #f4f8fb;
    --surface-0: #ffffff;
    --line-200: #d8e5f0;
    --brand-700: #145c9e;
    --brand-600: #1c75bc;
    --teal-600: #0d9b8a;
    --amber-600: #c98611;
    --danger-600: #b73333;
    --success-600: #0f8f5f;
    --shadow-soft: 0 16px 40px rgba(8, 33, 55, 0.14);
    --shadow-card: 0 20px 45px rgba(7, 27, 47, 0.18);
}

* {
    box-sizing: border-box;
}

body.public-ui {
    margin: 0;
    min-height: 100vh;
    font-family: 'Source Sans 3', 'Trebuchet MS', sans-serif;
    color: var(--text-900);
    background:
        radial-gradient(1200px 650px at -8% -12%, rgba(13, 155, 138, 0.18), transparent 58%),
        radial-gradient(900px 540px at 98% 10%, rgba(20, 92, 158, 0.18), transparent 60%),
        linear-gradient(140deg, #eef4f8 0%, #dde8f1 100%);
}

.brand-wordmark,
.hero-title,
.action-title,
.auth-title,
.auth-side h2 {
    font-family: 'Sora', 'Segoe UI', sans-serif;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    width: 100%;
    backdrop-filter: blur(8px);
    background: rgba(244, 248, 251, 0.86);
    border-bottom: 1px solid rgba(16, 38, 58, 0.08);
}

.topbar-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 22px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-900);
}

.brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: linear-gradient(145deg, var(--teal-600) 0%, var(--brand-700) 100%);
    box-shadow: 0 8px 20px rgba(13, 155, 138, 0.24);
}

.brand-wordmark {
    margin: 0;
    font-size: 28px;
    line-height: 1;
    letter-spacing: -0.5px;
}

.btn-top {
    border: 0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--brand-700) 0%, var(--brand-600) 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 15px;
    padding: 11px 18px;
    border-radius: 11px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 10px 20px rgba(20, 92, 158, 0.26);
}

.btn-top:hover {
    transform: translateY(-2px);
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 14px 24px rgba(20, 92, 158, 0.3);
}

.page-wrap {
    max-width: 1160px;
    margin: 20px auto 34px;
    padding: 0 20px;
}

.hero-panel {
    background: linear-gradient(135deg, #0a2f4b 0%, #0f4770 62%, #13647f 100%);
    color: #eff8ff;
    border-radius: 24px;
    box-shadow: var(--shadow-card);
    padding: 36px;
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 24px;
}

.hero-panel::before,
.hero-panel::after {
    content: '';
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

.hero-panel::before {
    width: 370px;
    height: 370px;
    right: -120px;
    top: -140px;
    background: radial-gradient(circle, rgba(13, 155, 138, 0.24) 0%, rgba(13, 155, 138, 0) 70%);
}

.hero-panel::after {
    width: 340px;
    height: 340px;
    left: -100px;
    bottom: -180px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 66%);
}

.hero-copy,
.hero-stats {
    position: relative;
    z-index: 1;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    padding: 7px 12px;
    margin-bottom: 14px;
}

.hero-title {
    margin: 0;
    font-size: clamp(32px, 5vw, 48px);
    line-height: 1.06;
    letter-spacing: -0.6px;
}

.hero-subtitle {
    margin: 16px 0 0;
    font-size: 20px;
    font-weight: 500;
    color: rgba(239, 248, 255, 0.9);
}

.hero-note {
    margin: 16px 0 0;
    font-size: 15px;
    color: rgba(239, 248, 255, 0.84);
}

.hero-stats {
    align-self: end;
    display: grid;
    gap: 12px;
}

.stat-chip {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 14px;
    padding: 13px 14px;
}

.stat-chip .label {
    font-size: 11px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: rgba(239, 248, 255, 0.78);
}

.stat-chip .value {
    display: block;
    margin-top: 5px;
    font-size: 20px;
    font-weight: 700;
}

.alert-soft {
    margin-top: 16px;
    border-radius: 12px;
    padding: 13px 14px;
    border: 1px solid #f0d7ad;
    background: #fff8ea;
    color: #7f4a00;
    font-weight: 600;
}

.actions-grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.action-card {
    text-decoration: none;
    color: #ffffff;
    border-radius: 20px;
    min-height: 250px;
    padding: 24px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    animation: riseIn 0.6s both;
}

.action-card:nth-child(2) {
    animation-delay: 0.09s;
}

.action-card:nth-child(3) {
    animation-delay: 0.18s;
}

.action-card:hover {
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-6px);
    box-shadow: 0 26px 48px rgba(7, 27, 47, 0.24);
}

.action-create {
    background: linear-gradient(145deg, #2165aa 0%, #1f4f86 100%);
}

.action-scan {
    background: linear-gradient(145deg, #0f9c8d 0%, #167f85 100%);
}

.action-track {
    background: linear-gradient(145deg, #d28b14 0%, #b87412 100%);
}

.action-icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.19);
    border: 1px solid rgba(255, 255, 255, 0.38);
    font-size: 24px;
}

.action-title {
    margin: 2px 0 0;
    font-size: 33px;
    line-height: 1.1;
    letter-spacing: -0.3px;
}

.action-desc {
    margin: 0;
    color: rgba(255, 255, 255, 0.92);
    font-size: 17px;
    line-height: 1.42;
}

.action-foot {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
}

.auth-wrap {
    width: 100%;
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 20px 36px;
}

.auth-grid {
    width: min(1120px, 100%);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.auth-side {
    border-radius: 24px;
    color: #f4fbff;
    background: linear-gradient(150deg, #0d3657 0%, #106780 78%);
    padding: 34px;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.auth-side::after {
    content: '';
    position: absolute;
    width: 380px;
    height: 380px;
    border-radius: 999px;
    right: -140px;
    bottom: -170px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 70%);
}

.auth-side h2 {
    margin: 0;
    font-size: 39px;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.auth-side p {
    margin: 14px 0 0;
    color: rgba(244, 251, 255, 0.88);
    font-size: 16px;
}

.auth-points {
    position: relative;
    z-index: 1;
    margin: 24px 0 0;
    padding-left: 0;
    list-style: none;
    display: grid;
    gap: 9px;
}

.auth-points li {
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 11px;
    padding: 10px 12px;
    font-size: 15px;
    font-weight: 600;
}

.auth-card {
    border-radius: 24px;
    background: var(--surface-0);
    box-shadow: var(--shadow-soft);
    padding: 30px;
    border: 1px solid rgba(16, 38, 58, 0.06);
}

.auth-title {
    margin: 0;
    font-size: 30px;
    letter-spacing: -0.3px;
}

.auth-subtitle {
    margin: 8px 0 0;
    color: var(--text-700);
    font-size: 15px;
}

.error-message {
    margin-top: 16px;
    color: #7f1f1f;
    border: 1px solid #efb4b4;
    border-left: 4px solid var(--danger-600);
    background: #fff0f0;
    border-radius: 10px;
    padding: 11px 13px;
    font-weight: 600;
}

.form-shell {
    margin-top: 18px;
}

.form-group label {
    color: var(--text-900);
    font-weight: 700;
    margin-bottom: 8px;
}

.form-control {
    border-radius: 12px;
    border: 1px solid var(--line-200);
    min-height: 48px;
    padding: 11px 14px;
    font-size: 15px;
    box-shadow: none;
}

.form-control:focus {
    border-color: #6da8d8;
    box-shadow: 0 0 0 0.18rem rgba(28, 117, 188, 0.15);
}

.role-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.btn-role {
    border: 1px solid var(--line-200);
    border-radius: 12px;
    min-height: 44px;
    background: #f4f8fb;
    color: #2f4d66;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-role:hover {
    border-color: #7cb1de;
    color: #135589;
}

.btn-role.active {
    color: #ffffff;
    border-color: #1a6eaf;
    background: linear-gradient(140deg, #145c9e 0%, #1c75bc 100%);
    box-shadow: 0 8px 18px rgba(20, 92, 158, 0.24);
}

.btn-submit {
    width: 100%;
    margin-top: 14px;
    border: 0;
    border-radius: 12px;
    min-height: 48px;
    background: linear-gradient(140deg, #0d9b8a 0%, #0f8f5f 100%);
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.2px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 12px 22px rgba(15, 143, 95, 0.23);
}

.btn-submit:hover {
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 16px 28px rgba(15, 143, 95, 0.28);
}

.demo-credentials {
    margin-top: 16px;
    border-radius: 12px;
    border: 1px solid #cde3f3;
    background: #edf7ff;
    padding: 12px 14px;
    color: #1f4f77;
}

.demo-credentials strong {
    display: block;
    margin-bottom: 6px;
}

.demo-credentials p {
    margin: 0;
    line-height: 1.4;
}

.home-link {
    margin-top: 14px;
    text-align: center;
}

.home-link a {
    color: #185f97;
    font-weight: 700;
    text-decoration: none;
}

.home-link a:hover {
    text-decoration: underline;
}

@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1024px) {
    .hero-panel {
        grid-template-columns: 1fr;
    }

    .actions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .auth-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .topbar-inner,
    .page-wrap,
    .auth-wrap {
        padding-left: 14px;
        padding-right: 14px;
    }

    .hero-panel,
    .auth-side,
    .auth-card {
        border-radius: 18px;
    }

    .hero-panel {
        padding: 24px 18px;
    }

    .hero-title {
        font-size: 34px;
    }

    .hero-subtitle {
        font-size: 18px;
    }

    .actions-grid {
        grid-template-columns: 1fr;
    }

    .action-card {
        min-height: 220px;
    }

    .action-title {
        font-size: 30px;
    }

    .auth-side {
        padding: 24px 20px;
    }

    .auth-side h2 {
        font-size: 32px;
    }

    .auth-card {
        padding: 22px 18px;
    }
}
