/* =========================================================
   Tifbi Web App
   Shared styles for /app/
   Brand: #00ABE9
   ========================================================= */

:root {
    color-scheme: light dark;

    --brand: #00ABE9;
    --brand-hover: #0099D2;
    --brand-active: #0089BD;
    --brand-soft: #E7F8FE;
    --brand-soft-strong: #D7F3FD;

    --background: #F6F8FA;
    --surface: #FFFFFF;
    --surface-secondary: #F4F7F9;

    --text: #18212A;
    --text-secondary: #66727D;
    --text-light: #89939C;

    --border: #E1E7EB;
    --border-hover: #C8D3DA;

    --success: #16A36A;
    --warning: #D99000;
    --danger: #D64545;

    --shadow: 0 8px 28px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 12px 34px rgba(0, 0, 0, 0.10);

    --radius: 18px;
    --radius-small: 10px;

    --content-width: 1040px;
}


/* =========================================================
   Dark mode
   ========================================================= */

@media (prefers-color-scheme: dark) {

    :root {
        --brand: #00ABE9;
        --brand-hover: #20B9F0;
        --brand-active: #45C5F4;

        --brand-soft: rgba(0, 171, 233, 0.13);
        --brand-soft-strong: rgba(0, 171, 233, 0.20);

        --background: #101417;
        --surface: #181D21;
        --surface-secondary: #20262B;

        --text: #F2F5F7;
        --text-secondary: #A7B0B8;
        --text-light: #7E8992;

        --border: #2D353B;
        --border-hover: #44515A;

        --success: #42CA8D;
        --warning: #F0B84A;
        --danger: #FF7777;

        --shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
        --shadow-hover: 0 14px 38px rgba(0, 0, 0, 0.38);
    }
}


/* =========================================================
   Reset
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    background: var(--background);
    color: var(--text);

    -webkit-font-smoothing: antialiased;
}

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

a {
    color: inherit;
}


/* =========================================================
   Header
   ========================================================= */

.app-header {
    height: 64px;

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

    padding: 0 30px;

    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 9px;

    text-decoration: none;
}

.app-brand-name {
    color: var(--brand);

    font-size: 23px;
    font-weight: 750;
    letter-spacing: -0.5px;
}

.plus-badge {
    display: inline-flex;
    align-items: center;

    height: 23px;
    padding: 0 9px;

    border-radius: 999px;

    background: var(--brand-soft);
    color: var(--brand);

    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.6px;
}

.app-header-link {
    color: var(--text-secondary);

    font-size: 14px;
    text-decoration: none;
}

.app-header-link:hover {
    color: var(--brand);
}


/* =========================================================
   Containers
   ========================================================= */

.app-container {
    width: 100%;
    max-width: var(--content-width);

    margin: 0 auto;
    padding: 44px 24px 70px;
}

.app-container-narrow {
    max-width: 820px;
}


/* =========================================================
   Back link
   ========================================================= */

.back-link {
    display: inline-flex;
    align-items: center;

    margin-bottom: 26px;

    color: var(--text-secondary);

    font-size: 14px;
    font-weight: 600;

    text-decoration: none;
}

.back-link:hover {
    color: var(--brand);
}


/* =========================================================
   Page heading
   ========================================================= */

.page-heading {
    margin-bottom: 28px;
}

.page-heading-centered {
    max-width: 720px;
    margin: 0 auto 42px;
    text-align: center;
}

.page-icon {
    width: 48px;
    height: 48px;

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

    margin-bottom: 16px;

    border-radius: 14px;

    background: var(--brand);
    color: #FFFFFF;

    font-size: 23px;
}

.page-heading h1 {
    margin: 0 0 10px;

    color: var(--text);

    font-size: 32px;
    line-height: 1.2;
    font-weight: 730;
    letter-spacing: -0.7px;
}

.page-heading-centered h1 {
    font-size: 40px;
}

.page-heading p {
    margin: 0;

    color: var(--text-secondary);

    font-size: 16px;
    line-height: 1.6;
}


/* =========================================================
   Cards
   ========================================================= */

.card {
    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow);
}

.card-padding {
    padding: 28px;
}

.card-interactive {
    transition:
        transform 160ms ease,
        box-shadow 160ms ease,
        border-color 160ms ease;
}

.card-interactive:hover {
    transform: translateY(-2px);

    border-color: var(--border-hover);

    box-shadow: var(--shadow-hover);
}

.card-featured {
    border-color: rgba(0, 171, 233, 0.55);

    background:
        linear-gradient(
            145deg,
            var(--brand-soft) 0%,
            var(--surface) 48%
        );
}

.card-featured:hover {
    border-color: var(--brand);
}


/* =========================================================
   Grid
   ========================================================= */

.card-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 20px;
}


/* =========================================================
   Typography
   ========================================================= */

.section-title {
    margin: 0 0 7px;

    color: var(--text);

    font-size: 18px;
    font-weight: 680;
}

.section-description {
    margin: 0 0 24px;

    color: var(--text-secondary);

    font-size: 14px;
    line-height: 1.55;
}

.text-secondary {
    color: var(--text-secondary);
}

.text-light {
    color: var(--text-light);
}

.text-brand {
    color: var(--brand);
}


/* =========================================================
   Buttons
   ========================================================= */

.btn {
    min-height: 43px;

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

    padding: 0 18px;

    border: 1px solid var(--border);
    border-radius: var(--radius-small);

    background: var(--surface);
    color: var(--text);

    font-size: 14px;
    font-weight: 650;

    text-decoration: none;
    cursor: pointer;

    transition:
        background 140ms ease,
        border-color 140ms ease,
        color 140ms ease,
        transform 80ms ease;
}

.btn:hover {
    color: var(--brand);
    border-color: var(--brand);
}

.btn:active {
    transform: scale(0.985);
}

.btn-primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #FFFFFF;
}

.btn-primary:hover {
    background: var(--brand-hover);
    border-color: var(--brand-hover);
    color: #FFFFFF;
}

.btn-primary:active {
    background: var(--brand-active);
}

.btn:disabled {
    opacity: 0.55;
    cursor: default;
}


/* =========================================================
   Forms
   ========================================================= */

.field {
    margin-bottom: 24px;
}

.field label {
    display: block;

    margin-bottom: 7px;

    color: var(--text);

    font-size: 14px;
    font-weight: 650;
}

.required {
    color: var(--brand);
}

.field-help {
    margin: 7px 0 0;

    color: var(--text-light);

    font-size: 12px;
    line-height: 1.45;
}

input,
textarea,
select {
    width: 100%;

    border: 1px solid var(--border);
    border-radius: var(--radius-small);

    background: var(--surface);
    color: var(--text);

    outline: none;

    transition:
        border-color 140ms ease,
        box-shadow 140ms ease;
}

input,
select {
    height: 46px;
    padding: 0 13px;
}

textarea {
    min-height: 110px;

    padding: 12px 13px;

    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-light);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--brand);

    box-shadow:
        0 0 0 3px var(--brand-soft);
}


/* =========================================================
   Information boxes
   ========================================================= */

.info-box {
    display: flex;
    gap: 14px;

    padding: 18px;

    border-radius: 12px;

    background: var(--brand-soft);
}

.info-box-icon {
    flex: 0 0 auto;

    font-size: 20px;
}

.info-box strong {
    display: block;

    margin-bottom: 4px;

    font-size: 14px;
}

.info-box p {
    margin: 0;

    color: var(--text-secondary);

    font-size: 13px;
    line-height: 1.5;
}


/* =========================================================
   Form actions
   ========================================================= */

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 11px;

    margin-top: 28px;
    padding-top: 25px;

    border-top: 1px solid var(--border);
}


/* =========================================================
   Status badges
   ========================================================= */

.status {
    display: inline-flex;
    align-items: center;

    min-height: 25px;

    padding: 0 9px;

    border-radius: 999px;

    font-size: 11px;
    font-weight: 700;
}

.status-active,
.status-ready {
    color: var(--success);
    background: color-mix(
        in srgb,
        var(--success) 12%,
        transparent
    );
}

.status-progress {
    color: var(--brand);
    background: var(--brand-soft);
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 760px) {

    .app-header {
        height: 60px;
        padding: 0 18px;
    }

    .app-header-link {
        display: none;
    }

    .app-container {
        padding: 30px 16px 50px;
    }

    .page-heading-centered {
        margin-bottom: 30px;
    }

    .page-heading h1 {
        font-size: 28px;
    }

    .page-heading-centered h1 {
        font-size: 31px;
    }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .card-padding {
        padding: 22px;
    }
}

@media (max-width: 480px) {

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .btn {
        width: 100%;
    }
}


/* =========================================================
   Accessibility
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        transition: none !important;
    }
}
