/* ========================================
   KIRA LEDGER — RESPONSIVE AUTHENTICATION
   ======================================== */

.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: 24px;
    box-sizing: border-box;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #f4f7fb;
    color: #172b4d;
    font-family: Inter, -apple-system, BlinkMacSystemFont,
                 "Segoe UI", Roboto, Arial, sans-serif;

    -webkit-font-smoothing: antialiased;
}

.auth-page *,
.auth-page *::before,
.auth-page *::after {
    box-sizing: border-box;
}

.auth-wrap {
    width: 100%;
    max-width: 440px;
    margin: auto;
}

.auth-card {
    width: 100%;
    padding: 40px;
    background: #ffffff;
    border: 1px solid #e6ebf2;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(23, 43, 77, 0.07);
}

/* Brand */

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-bottom: 30px;
    color: inherit;
    text-decoration: none;
}

.brand-name {
    font-size: 32px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -1.5px;
    color: #0879c9;
}

.brand-tag {
    align-self: flex-end;
    padding-bottom: 2px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
}

.auth-header h1 {
    margin: 0 0 9px;
    color: #172b4d;
    font-size: 26px;
    font-weight: 750;
    letter-spacing: -0.7px;
}

.auth-description {
    margin: 0;
    color: #718096;
    font-size: 14px;
    line-height: 1.6;
}

/* Form */

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.field-label {
    display: block;
    color: #334155;
    font-size: 13px;
    font-weight: 650;
}

.field-input {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 12px 14px;

    border: 1px solid #d9e1ec;
    border-radius: 10px;
    background: #ffffff;
    color: #172b4d;

    font: inherit;
    font-size: 14px;

    outline: none;
    transition: border-color 0.2s ease,
                box-shadow 0.2s ease,
                background 0.2s ease;
}

.field-input::placeholder {
    color: #a0aec0;
}

.field-input:hover {
    border-color: #aabbd0;
}

.field-input:focus {
    border-color: #0879c9;
    box-shadow: 0 0 0 3px rgba(8, 121, 201, 0.12);
}

.field-input:focus-visible {
    outline: none;
}

/* Button */

.auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    width: 100%;
    min-height: 49px;
    margin-top: 4px;
    padding: 13px 18px;

    border: 0;
    border-radius: 10px;
    background: #0879c9;
    color: #ffffff;

    font: inherit;
    font-size: 14px;
    font-weight: 700;

    cursor: pointer;
    transition: background 0.2s ease,
                transform 0.2s ease,
                box-shadow 0.2s ease;
}

.auth-submit:hover {
    background: #0667aa;
    box-shadow: 0 5px 14px rgba(8, 121, 201, 0.2);
}

.auth-submit:active {
    transform: translateY(1px);
}

.auth-submit:focus-visible {
    outline: 3px solid rgba(8, 121, 201, 0.3);
    outline-offset: 3px;
}

/* Success and error messages */

.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    margin-bottom: 22px;
    padding: 12px 14px;

    border: 1px solid transparent;
    border-radius: 10px;

    font-size: 13px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 20px;

    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 800;
}

.success-toast {
    color: #166534;
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.success-toast .toast-icon {
    color: #ffffff;
    background: #16a34a;
}

.error-toast {
    color: #b42318;
    background: #fef2f2;
    border-color: #fecaca;
}

.error-toast .toast-icon {
    color: #ffffff;
    background: #dc2626;
}

/* Footer */

.auth-footer {
    margin-top: 25px;
    padding-top: 22px;
    border-top: 1px solid #edf0f5;
    text-align: center;
}

.auth-footer p {
    margin: 0;
    color: #718096;
    font-size: 13px;
    line-height: 1.7;
}

.auth-footer a {
    color: #0879c9;
    font-weight: 700;
    text-decoration: none;
}

.auth-footer a:hover {
    color: #0667aa;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-bottom {
    margin-top: 22px;
    color: #a0aec0;
    font-size: 11px;
    letter-spacing: 0.3px;
    text-align: center;
}

/* Mobile responsive */

@media (max-width: 480px) {
    .auth-page {
        padding: 16px;
    }

    .auth-wrap {
        max-width: 100%;
    }

    .auth-card {
        padding: 30px 22px;
        border-radius: 16px;
    }

    .auth-header {
        margin-bottom: 26px;
    }

    .brand {
        margin-bottom: 25px;
    }

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

    .auth-form {
        gap: 18px;
    }

    .auth-footer {
        margin-top: 22px;
        padding-top: 20px;
    }
}

/* Short screens and landscape phones */

@media (max-height: 600px) {
    .auth-page {
        align-items: flex-start;
    }

    .auth-card {
        margin-top: 8px;
        margin-bottom: 8px;
    }
}

/* Respect accessibility preferences */

@media (prefers-reduced-motion: reduce) {
    .field-input,
    .auth-submit {
        transition: none;
    }
}

/* USED IN REGISTRATIONS PAGES*/

/* ========================================
   KIRA LEDGER — REGISTRATION PAGE
   ======================================== */

.register-card {
    max-width: 100%;
}

/* Keep four fields comfortable without excessive vertical space */

.register-card .auth-header {
    margin-bottom: 25px;
}

.register-card .brand {
    margin-bottom: 24px;
}

.register-card .auth-form {
    gap: 17px;
}

.register-card .field-hint {
    margin: -2px 0 0;
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.5;
}

.register-card .auth-submit {
    margin-top: 5px;
}

.register-card .auth-footer {
    margin-top: 22px;
}

/* Slightly tighter on small screens */

@media (max-width: 480px) {
    .register-card {
        padding: 26px 22px;
    }

    .register-card .auth-header {
        margin-bottom: 22px;
    }

    .register-card .brand {
        margin-bottom: 20px;
    }

    .register-card .auth-form {
        gap: 15px;
    }

    .register-card .field-input {
        min-height: 46px;
    }
}

/* END REGISTRATIONS PAGE*/

/* USE IN FOOTER PAGE*/

/* ========================================
   KIRA LEDGER — SITE FOOTER
   ======================================== */

.site-footer {
    margin-top: 64px;
    background: #ffffff;
    border-top: 1px solid #e6ebf2;
    color: #475569;
}

.site-footer .wrap {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 24px;
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(140px, 0.8fr) minmax(180px, 1fr);
    gap: 48px;
    padding-top: 44px;
    padding-bottom: 38px;
}

/* Brand */

.footer-brand {
    min-width: 0;
}

.footer-logo {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    color: #0879c9;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -1.1px;
    line-height: 1.2;
    text-decoration: none;
}

.footer-logo span {
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.footer-tagline {
    max-width: 340px;
    margin: 15px 0 18px;
    color: #718096;
    font-size: 13px;
    line-height: 1.8;
}

.footer-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 11px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #f8fafc;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
}

.footer-status-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: #0879c9;
}

/* Footer navigation columns */

.footer-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 13px;
    min-width: 0;
}

.footer-col h2 {
    margin: 3px 0 6px;
    color: #172b4d;
    font-size: 13px;
    font-weight: 750;
}

.footer-col a {
    color: #718096;
    font-size: 13px;
    line-height: 1.5;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-col a:hover {
    color: #0879c9;
}

.footer-col a:focus-visible,
.footer-logo:focus-visible {
    outline: 2px solid #0879c9;
    outline-offset: 4px;
    border-radius: 3px;
}

.footer-note {
    max-width: 260px;
    margin: 3px 0 0;
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.8;
}

/* Copyright bar */

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 20px;
    padding-bottom: 20px;
    border-top: 1px solid #edf0f5;
    color: #94a3b8;
    font-size: 11px;
    line-height: 1.7;
}

.footer-bottom-note {
    text-align: right;
}

/* Tablet */

@media (max-width: 768px) {
    .site-footer {
        margin-top: 44px;
    }

    .footer-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 32px;
        padding-top: 34px;
        padding-bottom: 30px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

    .footer-tagline {
        max-width: 420px;
    }
}

/* Mobile */

@media (max-width: 480px) {
    .site-footer .wrap {
        padding-inline: 20px;
    }

    .footer-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 28px 20px;
        padding-top: 30px;
        padding-bottom: 26px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

    .footer-logo {
        font-size: 26px;
    }

    .footer-tagline {
        margin-top: 12px;
        font-size: 12px;
    }

    .footer-col {
        gap: 12px;
    }

    .footer-col h2 {
        font-size: 12px;
    }

    .footer-col a,
    .footer-note {
        font-size: 12px;
    }

    .footer-bottom {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
        padding-top: 17px;
        padding-bottom: 20px;
        font-size: 10px;
    }

    .footer-bottom-note {
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    .footer-col a {
        transition: none;
    }
}

/* END FOOTER PAGE*/

/* USE IN INDEX PAGE*/

/* Dashboard responsive layout */

.dashboard-summary {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 24px;
    min-width: 0;
}

.stat-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.stat-card {
    min-width: 0;
    padding: 22px;
    background: #fff;
    border: 1px solid #e6ebf2;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(23, 43, 77, .035);
}

.stat-heading {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 16px;
}

.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 10px;
    font-size: 18px;
}

.income-icon {
    color: #15803d;
    background: #f0fdf4;
}

.expense-icon {
    color: #dc2626;
    background: #fef2f2;
}

.net-icon {
    color: #0879c9;
    background: #eff6ff;
}

.stat-caption,
.panel-description {
    margin-top: 7px;
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.6;
}

.stat-card .value {
    font-size: clamp(20px, 2vw, 28px);
    font-weight: 750;
    line-height: 1.4;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

.positive,
.inc {
    color: #15803d;
}

.negative,
.exp {
    color: #dc2626;
}

.stamp {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    background: #eff6ff;
}

.stamp-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.stamp-label {
    color: #1e40af;
    font-size: 14px;
    font-weight: 700;
}

.stamp-description {
    color: #64748b;
    font-size: 12px;
}

.stamp-value {
    flex-shrink: 0;
    color: #0879c9;
    font-size: 30px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.stamp.negative {
    background: #fef2f2;
    border-color: #fecaca;
}

.stamp.negative .stamp-label,
.stamp.negative .stamp-value {
    color: #dc2626;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
    min-width: 0;
}

.panel {
    min-width: 0;
    padding: 24px;
    background: #fff;
    border: 1px solid #e6ebf2;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(23, 43, 77, .035);
}

.panel-header {
    margin-bottom: 24px;
}

.section-label {
    margin: 0;
    color: #172b4d;
    font-size: 16px;
    font-weight: 750;
}

.cat-list {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.cat-row,
.cat-info {
    display: flex;
    align-items: center;
    min-width: 0;
}

.cat-row {
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.cat-info {
    gap: 10px;
}

.cat-swatch {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    border-radius: 3px;
}

.cat-name {
    color: #475569;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.cat-amount {
    flex-shrink: 0;
    color: #172b4d;
    font-size: 13px;
    font-weight: 700;
    text-align: right;
}

.cat-bar-track {
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #edf2f7;
}

.cat-bar-fill {
    height: 100%;
    border-radius: inherit;
}

.empty-note {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 160px;
    color: #94a3b8;
    font-size: 13px;
    text-align: center;
}

.trend-table-wrap {
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.trend-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.trend-table th,
.trend-table td {
    padding: 13px 10px;
    border-bottom: 1px solid #edf0f5;
    text-align: right;
    white-space: nowrap;
}

.trend-table th {
    background: #f8fafc;
    color: #64748b;
    font-size: 11px;
}

.trend-table th:first-child,
.trend-table .trend-month {
    text-align: left;
}

.trend-table .trend-month {
    color: #334155;
    font-weight: 650;
}

@media (max-width: 900px) {
    .grid-2 {
        grid-template-columns: minmax(0, 1fr);
    }

    .stat-card {
        padding: 18px;
    }
}

@media (max-width: 560px) {
    .stat-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .stamp {
        padding: 17px;
    }

    .stamp-value {
        font-size: 25px;
    }

    .panel {
        padding: 18px;
    }

    .trend-table {
        min-width: 440px;
    }
}

/* END USE OF INDEX PAGE*/