/* =========================================================
   One Life Counseling - Power BI Dashboard Portal
   Full CSS: Login Screen + Dashboard Screen
========================================================= */

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

:root {
    --bg-primary: #0b0f19;
    --bg-secondary: #111827;

    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;

    --one-life-navy: #163a5f;
    --one-life-blue: #1d73c9;
    --one-life-sky: #dff2ff;
    --one-life-cyan: #00aeca;
    --one-life-text: #183b56;
    --one-life-muted: #66788a;
    --one-life-border: rgba(29, 115, 201, 0.18);

    --danger-color: #ef4444;
    --success-color: #10b981;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

html,
body {
    width: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
}

body {
    min-height: 100vh;
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* =========================================================
   Animations
========================================================= */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

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

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

/* =========================================================
   LOGIN PAGE
========================================================= */

body.login-page {
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    background-color: #eef8ff;
    color: var(--one-life-text);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 0;
}

/* Main background image layer with safe inset */
body.login-page::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("/images/logo.png");
    background-size: calc(100% - 70px) calc(100% - 70px);
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
}

/* Very soft overlay */
body.login-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.15), transparent 38%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(221, 241, 255, 0.08));
    pointer-events: none;
    z-index: -1;
}

.auth-container {
    width: 100%;
    max-width: 430px;
    padding: 0 20px;
    margin-top: 375px;
    position: relative;
    z-index: 2;
    animation: fadeIn 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.glass-card.login-card {
    position: static;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 253, 255, 0.80));
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 26px;
    padding: 34px 34px 28px;
    box-shadow:
        0 28px 80px rgba(22, 58, 95, 0.20),
        inset 0 1px 0 rgba(255, 255, 255, 0.88);
    transition: all 0.3s ease;
}

.glass-card.login-card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 34px 90px rgba(22, 58, 95, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.94);
    border-color: rgba(29, 115, 201, 0.25);
}

.login-card-top-accent {
    position: absolute;
    top: 0;
    left: 24px;
    right: 24px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, #1d73c9, #00b7c7, transparent);
    opacity: 0.95;
}

.brand-header,
.login-form-header {
    text-align: center;
    margin-bottom: 26px;
}

.login-mini-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 14px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 18px;
    background: linear-gradient(135deg, #1d73c9, #00b7c7);
    box-shadow: 0 14px 28px rgba(29, 115, 201, 0.25);
}

.brand-title {
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--one-life-navy);
    margin-bottom: 8px;
}

.brand-subtitle {
    font-size: 14px;
    line-height: 1.55;
    color: var(--one-life-muted);
    max-width: 310px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 18px;
    position: relative;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--one-life-navy);
    margin-bottom: 8px;
}

.input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.input-container i {
    position: absolute;
    left: 16px;
    color: #5b7d99;
    font-size: 15px;
    z-index: 2;
    transition: all 0.25s ease;
}

.form-input {
    width: 100%;
    height: 50px;
    padding: 14px 16px 14px 46px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(29, 115, 201, 0.18);
    border-radius: 15px;
    color: var(--one-life-text);
    font-size: 14px;
    font-weight: 500;
    outline: none;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.75),
        0 8px 18px rgba(22, 58, 95, 0.05);
    transition: all 0.25s ease;
}

.form-input::placeholder {
    color: rgba(102, 120, 138, 0.62);
    font-weight: 400;
}

.form-input:focus {
    border-color: rgba(29, 115, 201, 0.75);
    background: rgba(255, 255, 255, 0.98);
    box-shadow:
        0 0 0 4px rgba(29, 115, 201, 0.12),
        0 14px 30px rgba(29, 115, 201, 0.10);
}

.input-container:focus-within i {
    color: var(--one-life-blue);
}

.btn,
.login-btn {
    width: 100%;
    height: 52px;
    margin-top: 6px;
    padding: 0 18px;
    border: none;
    border-radius: 16px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.01em;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #163a5f 0%, #1d73c9 52%, #00aeca 100%);
    box-shadow:
        0 16px 32px rgba(29, 115, 201, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: all 0.25s ease;
}

.btn:hover,
.login-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 20px 40px rgba(29, 115, 201, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.30);
    background: linear-gradient(135deg, #102f50 0%, #176dc4 48%, #00b8c8 100%);
}

.btn:active,
.login-btn:active {
    transform: translateY(0);
}

.btn:disabled,
.login-btn:disabled {
    cursor: not-allowed;
    opacity: 0.76;
    transform: none;
}

.login-helper-text {
    margin-top: 18px;
    text-align: center;
    font-size: 12px;
    color: rgba(24, 59, 86, 0.62);
}

.alert {
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 13px;
    margin-bottom: 18px;
    display: none;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.09);
    border: 1px solid rgba(239, 68, 68, 0.22);
    color: #b42318;
}

/* =========================================================
   DASHBOARD / POWER BI REPORT PAGE
========================================================= */

body.dashboard-page {
    background-color: var(--bg-primary);
    background-image:
        radial-gradient(at 0% 0%, rgba(29, 115, 201, 0.18) 0px, transparent 48%),
        radial-gradient(at 100% 100%, rgba(0, 174, 202, 0.16) 0px, transparent 48%);
    background-attachment: fixed;
    color: var(--text-primary);
    display: flex;
    justify-content: stretch;
    align-items: stretch;
    overflow: hidden;
    padding: 0;
}

.app-layout {
    display: none;
    width: 100vw;
    height: 100vh;
    background-color: transparent;
    animation: fadeIn 0.45s ease;
}

.report-only-layout {
    overflow: hidden;
}

.main-content,
.report-main-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.report-view-container {
    flex: 1;
    width: 100%;
    min-height: 0;
    padding: 18px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.report-topbar {
    min-height: 62px;
    display: grid;
    grid-template-columns: minmax(160px, 1fr) auto minmax(280px, 1fr);
    align-items: center;
    gap: 16px;
    padding: 0 4px;
}

.topbar-left {
    justify-self: start;
}

.home-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-width: 105px;
    padding: 11px 18px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: linear-gradient(135deg, rgba(29, 115, 201, 0.30), rgba(0, 174, 202, 0.14));
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
    transition: all 0.25s ease;
}

.home-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 174, 202, 0.36);
    box-shadow: 0 12px 30px rgba(0, 174, 202, 0.16);
}

.report-title-block {
    justify-self: center;
    text-align: center;
}

.report-title-block h1 {
    font-size: 20px;
    line-height: 1.2;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.report-title-block p {
    margin-top: 4px;
    font-size: 12px;
    color: rgba(229, 231, 235, 0.72);
}

.topbar-user {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.topbar-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--one-life-cyan), var(--one-life-blue));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(0, 174, 202, 0.22);
}

.topbar-user-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
    min-width: 0;
}

.topbar-user-name {
    max-width: 150px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-user-role {
    margin-top: 4px;
    color: rgba(229, 231, 235, 0.68);
    font-size: 11px;
    font-weight: 600;
}

.topbar-logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 13px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.045);
    color: rgba(229, 231, 235, 0.78);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
}

.topbar-logout-btn:hover {
    color: #ffffff;
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.12);
    transform: translateY(-1px);
}

.embed-card {
    flex: 1;
    width: 100%;
    min-height: 0;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
}

#embedContainer {
    width: 100%;
    height: 100%;
    border: none;
}

/* =========================================================
   Loading / Error States
========================================================= */

.status-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: center;
    padding: 40px;
    width: 100%;
    height: 100%;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(29, 115, 201, 0.14);
    border-top: 3px solid var(--one-life-blue);
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

.status-state h3 {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.status-state p {
    font-size: 14px;
    color: #6b7280;
    max-width: 460px;
}

/* =========================================================
   Optional Mock Dashboard Styles
   Keep only if your app still uses renderMockDashboard()
========================================================= */

.mock-dashboard-wrapper {
    width: 100%;
    height: 100%;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    background-color: #0b0f19;
    overflow-y: auto;
}

.mock-metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.metric-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
}

.metric-val {
    font-size: 28px;
    font-weight: 700;
    color: white;
}

.metric-change {
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.metric-change.up {
    color: var(--success-color);
}

.metric-change.down {
    color: var(--danger-color);
}

.mock-charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    flex: 1;
}

.chart-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chart-card h4 {
    font-size: 15px;
    font-weight: 600;
    color: white;
}

.simulated-bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 180px;
    padding-top: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.bar-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.bar {
    width: 60%;
    max-width: 40px;
    background: linear-gradient(to top, var(--one-life-blue), var(--one-life-cyan));
    border-radius: 6px 6px 0 0;
}

.bar-label {
    font-size: 11px;
    color: var(--text-secondary);
}

.simulated-pie-chart {
    height: 180px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.pie-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: conic-gradient(
        var(--one-life-blue) 0% 55%,
        var(--one-life-cyan) 55% 85%,
        #3b82f6 85% 100%
    );
    position: relative;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

.pie-circle::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    background: #111827;
    border-radius: 50%;
    top: 30px;
    left: 30px;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* =========================================================
   Responsive
========================================================= */

@media (max-width: 1200px) {
    body.login-page::after {
        background-size: calc(100% - 48px) calc(100% - 60px);
    }

    .auth-container {
        margin-top: 360px;
    }
}

@media (max-height: 760px) {
    body.login-page {
        padding-top: 22px;
        padding-bottom: 28px;
    }

    body.login-page::after {
        background-size: calc(100% - 55px) calc(100% - 55px);
    }

    .auth-container {
        margin-top: 340px;
    }
}

@media (max-height: 650px) {
    .auth-container {
        margin-top: 300px;
    }
}

@media (max-width: 900px) {
    .auth-container {
        margin-top: 350px;
    }

    .mock-charts-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body.login-page {
        overflow-y: auto;
        align-items: flex-start;
        padding-top: 20px;
        padding-bottom: 28px;
    }

    body.login-page::after {
        background-size: calc(100% - 28px) calc(100% - 42px);
    }

    .auth-container {
        max-width: 420px;
        margin-top: 330px;
        padding: 0 18px 32px;
    }

    .glass-card.login-card {
        padding: 30px 24px 24px;
        border-radius: 22px;
    }

    .brand-title {
        font-size: 23px;
    }

    .brand-subtitle {
        font-size: 13px;
    }

    .report-view-container {
        padding: 14px;
    }

    .report-topbar {
        grid-template-columns: 1fr;
        align-items: stretch;
        min-height: auto;
    }

    .topbar-left,
    .report-title-block,
    .topbar-user {
        justify-self: stretch;
    }

    .report-title-block {
        text-align: left;
        order: -1;
    }

    .home-btn,
    .topbar-logout-btn {
        width: 100%;
    }

    .topbar-user {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .auth-container {
        margin-top: 285px;
    }

    .glass-card.login-card {
        padding: 26px 20px 22px;
    }

    .login-mini-icon {
        width: 44px;
        height: 44px;
    }

    .form-input {
        height: 48px;
    }

    .btn,
    .login-btn {
        height: 50px;
    }
}
/* =========================================================
   RESPONSIVE LOGIN CARD OVERRIDE
   Paste this block at the END of style.css
========================================================= */

body.login-page {
    align-items: flex-start !important;
    justify-content: center;
    overflow: hidden;
    padding-inline: clamp(12px, 2vw, 24px);
}

.auth-container {
    width: min(430px, calc(100vw - 32px));
    max-width: 430px;
    padding: 0;
    margin-left: auto;
    margin-right: auto;
    margin-top: clamp(255px, 39.5vh, 375px);
}

.glass-card.login-card {
    width: 100%;
}

/* Medium height screens */
@media (max-height: 760px) {
    .auth-container {
        margin-top: clamp(155px, 34vh, 280px);
    }

    .glass-card.login-card {
        padding: 28px 28px 24px;
    }

    .brand-header,
    .login-form-header {
        margin-bottom: 18px;
    }
}

/* Small laptop / short screen */
@media (max-height: 620px) {
    .auth-container {
        margin-top: clamp(90px, 24vh, 160px);
    }

    .glass-card.login-card {
        padding: 22px 22px 18px;
        border-radius: 22px;
    }

    .login-mini-icon {
        width: 38px;
        height: 38px;
        margin-bottom: 8px;
        border-radius: 13px;
        font-size: 15px;
    }

    .brand-title {
        font-size: 22px;
        margin-bottom: 4px;
    }

    .brand-header p,
    .brand-subtitle {
        font-size: 12px;
        line-height: 1.35;
    }

    .form-group {
        margin-bottom: 10px;
    }

    .form-label {
        font-size: 11px;
        margin-bottom: 5px;
    }

    .form-input {
        height: 42px;
        border-radius: 13px;
        font-size: 13px;
    }

    .btn,
    .login-btn {
        height: 44px;
        border-radius: 14px;
        font-size: 14px;
    }

    .login-helper-text {
        margin-top: 10px;
    }
}

/* Very small height like 800x396 screenshot */
@media (max-height: 500px) {
    .auth-container {
        margin-top: clamp(68px, 19vh, 95px);
    }

    .glass-card.login-card {
        padding: 16px 18px 14px;
        border-radius: 18px;
    }

    .brand-header,
    .login-form-header {
        margin-bottom: 10px;
    }

    .login-mini-icon {
        width: 30px;
        height: 30px;
        margin-bottom: 6px;
        border-radius: 10px;
        font-size: 13px;
    }

    .brand-title {
        font-size: 20px;
    }

    .form-group {
        margin-bottom: 8px;
    }

    .form-input {
        height: 38px;
        padding-left: 42px;
    }

    .btn,
    .login-btn {
        height: 40px;
        margin-top: 4px;
    }

    .login-helper-text {
        display: none;
    }
}

/* Mobile width */
@media (max-width: 480px) {
    .auth-container {
        width: calc(100vw - 24px);
        margin-top: clamp(155px, 35vh, 285px);
    }

    .glass-card.login-card {
        padding-left: 18px;
        padding-right: 18px;
    }
}

@media (max-width: 480px) and (max-height: 620px) {
    .auth-container {
        margin-top: clamp(82px, 22vh, 130px);
    }
}

@media (max-width: 480px) and (max-height: 500px) {
    .auth-container {
        margin-top: clamp(58px, 17vh, 85px);
    }
}