/*
 * YEBALI — Refined login layout
 * Location: new_app/assets/css/login.css
 */

:root {
    color-scheme: light;

    --olive-dark: #43582e;
    --olive: #607640;
    --gold: #c7983f;

    --surface: #fffdfa;
    --text: #302d26;
    --muted: #756e62;
    --border: #e6dccd;

    font-family: Tahoma, Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;

    color: var(--text);

    background:
        radial-gradient(
            circle at 12% 90%,
            rgb(177 145 88 / 10%),
            transparent 42%
        ),
        linear-gradient(
            145deg,
            #f8f5ef,
            #efe8dd
        );

    font-size: 14px;
    line-height: 1.7;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

button,
input,
a {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid var(--olive-dark);
    outline-offset: 4px;
}

[hidden] {
    display: none !important;
}

/* Keyboard access */

.skip-link {
    position: absolute;
    inset-block-start: 10px;
    inset-inline-start: 10px;
    z-index: 10;

    padding: 10px 16px;
    border-radius: 10px;

    color: var(--olive-dark);
    background: white;

    text-decoration: none;
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: translateY(0);
}

/* Centered card */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 100vh;
    min-height: 100svh;

    padding: 30px 22px;
}

.login-shell {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr);

    width: 100%;
    max-width: 1000px;

    border: 1px solid #e8dfd2;
    border-radius: 22px;

    background: var(--surface);

    box-shadow:
        0 20px 55px rgb(67 51 27 / 10%);

    overflow: hidden;
}

.brand-panel,
.form-panel {
    min-width: 0;
}

/* Olive and gold brand panel */

.brand-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 30px;

    min-height: 600px;
    padding: 30px;

    color: white;

    background:
        radial-gradient(
            circle at 12% 12%,
            rgb(255 255 255 / 9%),
            transparent 35%
        ),
        radial-gradient(
            circle at 100% 100%,
            rgb(223 161 47 / 28%),
            transparent 45%
        ),
        linear-gradient(
            135deg,
            #4c6233 0%,
            #708148 65%,
            #bb8d37 100%
        );
}

.brand-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand-wordmark {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
}

.brand-wordmark span[lang="en"] {
    font-family: Arial, sans-serif;
    font-size: 23px;
    font-weight: 800;
    letter-spacing: 1.5px;
    line-height: 1.3;
}

.brand-wordmark span[lang="ar"] {
    color: #fff0ca;
    font-size: 20px;
    font-weight: 700;
}

.brand-byline {
    color: #fff0ca;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
}

.brand-content {
    width: 100%;
    max-width: 400px;
    margin-inline: auto;

    text-align: center;
}

.brand-kicker {
    display: inline-block;
    max-width: 100%;

    padding: 6px 14px;

    border: 1px solid rgb(255 255 255 / 23%);
    border-radius: 30px;

    background: rgb(255 255 255 / 10%);
    color: #fff8e9;

    font-size: 11px;
    font-weight: 600;
}

.brand-content h1 {
    max-width: 350px;
    margin: 23px auto 15px;

    font-size: 30px;
    font-weight: 700;
    line-height: 1.6;
    text-wrap: balance;
}

.brand-description {
    max-width: 380px;
    margin: 0 auto;

    color: #fff9ef;
    font-size: 13px;
    line-height: 1.95;
}

.brand-features {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;

    margin: 25px 0 0;
    padding: 0;

    list-style: none;
}

.brand-features li {
    padding: 5px 11px;

    border: 1px solid rgb(255 255 255 / 25%);
    border-radius: 30px;

    background: rgb(255 255 255 / 7%);

    font-size: 10px;
    line-height: 1.7;
}

.brand-footer {
    padding-block-start: 16px;

    color: #fff0ca;
    text-align: center;

    font-size: 10px;
    letter-spacing: 1.6px;
}

/* Form */

.form-panel {
    display: flex;
    flex-direction: column;

    padding: 27px 34px 22px;

    background:
        radial-gradient(
            circle at top right,
            rgb(204 163 91 / 6%),
            transparent 35%
        ),
        linear-gradient(
            180deg,
            #fffdfa,
            #faf6ef
        );
}

.form-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.workspace-label {
    display: inline-block;

    padding: 6px 12px;
    border-radius: 30px;

    color: #8c622b;
    background: #f6eddf;

    font-size: 10px;
    font-weight: 700;
}

.language-form {
    margin: 0;
}

.language-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 100px;
    min-height: 44px;
    padding: 7px 14px;

    border: 1px solid var(--border);
    border-radius: 11px;

    color: var(--olive-dark);
    background: white;

    font-size: 12px;
    font-weight: 500;
}

.form-content {
    width: 100%;
    max-width: 400px;

    margin: auto;
    padding-block: 22px 18px;
}

.form-heading {
    margin-block-end: 21px;
    text-align: center;
}

.welcome-label {
    margin: 0 0 5px;

    color: #806633;
    font-size: 11px;
    font-weight: 500;
}

.form-heading h2 {
    margin: 0 0 8px;

    color: var(--olive-dark);
    font-size: 32px;
    font-weight: 700;
    line-height: 1.45;
}

.form-heading > p:last-child {
    margin: 0;

    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
}

.login-form {
    margin: 0;
}

.form-field {
    margin-block-end: 16px;
}

.form-field label {
    display: flex;
    align-items: center;
    gap: 5px;

    margin-block-end: 7px;

    color: var(--text);
    font-size: 13px;
    font-weight: 600;
}

.form-field label > span {
    color: #aa4d2d;
}

.text-input {
    display: block;

    width: 100%;
    min-width: 0;
    min-height: 48px;

    padding: 10px 14px;

    border: 1px solid var(--border);
    border-radius: 13px;

    color: var(--text);
    background: white;

    font-size: 16px;
    line-height: 1.5;
}

.text-input:focus {
    border-color: #71874b;
    outline: 2px solid #71874b;
    outline-offset: 2px;

    box-shadow: 0 0 0 4px rgb(113 135 75 / 8%);
}

.code-input {
    font-family: Arial, sans-serif;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.7px;
    text-align: start;
}

.field-help {
    margin: 6px 0 0;

    color: var(--muted);
    font-size: 11px;
    line-height: 1.7;
}

.submit-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    width: 100%;
    min-height: 50px;

    margin-block-start: 20px;
    padding: 10px 18px;

    border: 0;
    border-block-end: 2px solid var(--gold);
    border-radius: 13px;

    color: white;

    background: linear-gradient(
        100deg,
        #597239,
        #738649
    );

    box-shadow:
        0 8px 20px rgb(89 114 57 / 12%);

    font-size: 15px;
    font-weight: 700;
}

.submit-button > span {
    font-size: 18px;
}

.submit-button:disabled {
    cursor: wait;
    opacity: 0.7;
}

.account-note {
    margin: 15px 0 0;

    color: var(--muted);
    text-align: center;

    font-size: 11px;
    line-height: 1.85;
}

.form-footer {
    padding-block-start: 10px;

    color: #6c705e;
    text-align: center;

    font-size: 10px;
    letter-spacing: 0.4px;
}

/* Error message */

.form-alert {
    margin-block-end: 18px;
    padding: 11px 13px;

    border: 1px solid #e8bdb4;
    border-radius: 11px;

    color: #8d3027;
    background: #fff2ee;

    font-size: 12px;
    line-height: 1.8;

    overflow-wrap: anywhere;
}

/* Pointer interactions */

@media (hover: hover) {
    .language-button:hover {
        border-color: #89986c;
        background: #f7f8f2;
    }

    .submit-button:not(:disabled):hover {
        background: #536d35;
    }
}

/* Smaller laptops and tablets */

@media (min-width: 761px) and (max-width: 1050px) {
    .login-page {
        padding: 24px;
    }

    .brand-panel {
        padding: 26px;
    }

    .form-panel {
        padding: 25px;
    }

    .brand-content h1 {
        font-size: 27px;
    }

    .form-heading h2 {
        font-size: 29px;
    }
}

/* Short screens: allow natural scrolling, never crop the form */

@media (min-width: 761px) and (max-height: 720px) {
    .login-page {
        padding-block: 18px;
    }

    .brand-panel {
        min-height: 0;
    }

    .form-panel {
        padding-block: 20px;
    }

    .form-content {
        padding-block: 17px;
    }
}

/* Mobile: compact brand header, then the form */

@media (max-width: 760px) {
    .login-page {
        padding: 18px 14px;
    }

    .login-shell {
        max-width: 480px;

        grid-template-columns: minmax(0, 1fr);
        border-radius: 20px;
    }

    .brand-panel {
        min-height: 0;
        gap: 10px;

        padding: 20px 24px;
    }

    .brand-header {
        align-items: center;
    }

    .brand-wordmark span[lang="en"] {
        font-size: 22px;
    }

    .brand-wordmark span[lang="ar"] {
        font-size: 19px;
    }

    .brand-content {
        max-width: none;
        text-align: start;
    }

    .brand-kicker {
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;

        font-size: 11px;
    }

    .brand-content h1,
    .brand-description,
    .brand-features,
    .brand-footer {
        display: none;
    }

    .form-panel {
        padding: 22px 24px;
    }

    .form-content {
        max-width: none;
        padding-block: 22px 16px;
    }

    .form-heading h2 {
        font-size: 29px;
    }

    .text-input {
        min-height: 50px;
        font-size: 16px;
    }

    .submit-button {
        min-height: 52px;
    }

    .form-field {
        margin-block-end: 17px;
    }
}

/* Narrow phones */

@media (max-width: 360px) {
    .login-page {
        padding: 10px 8px;
    }

    .brand-panel,
    .form-panel {
        padding-inline: 17px;
    }

    .form-toolbar {
        gap: 8px;
    }

    .language-button {
        min-width: 85px;
        padding-inline: 10px;
    }

    .workspace-label {
        padding-inline: 9px;
        font-size: 9px;
    }

    .form-heading h2 {
        font-size: 26px;
    }

    .brand-wordmark span[lang="en"] {
        font-size: 20px;
    }
}

/* Motion preferences */

@media (prefers-reduced-motion: no-preference) {
    .language-button,
    .submit-button,
    .text-input {
        transition:
            background-color 150ms ease,
            border-color 150ms ease,
            box-shadow 150ms ease;
    }
}
