/*
File: assets/css/franchise/franchise-login.css
Purpose: Natural-size Franchise login interface for mobile, tablet, laptop and desktop.

Used By:
- franchise/franchise-login.php

Connection Notes:
- Icons are supplied by Font Awesome in franchise-login.php.
- Password visibility and Franchise ID validation are handled by
  assets/js/franchise/franchise-login.js.
- Authentication and account-status checks remain in franchise-login.php.
*/

/* ==============================================================
   1. Theme and Page Foundation
   ============================================================== */
:root {
    --franchise-theme: #08783c;
    --franchise-theme-dark: #05652f;
    --franchise-ink: #173d2a;
    --franchise-muted: #5c7465;
    --franchise-line: #d6e7dc;
    --franchise-soft: #f2fbf5;
    --franchise-error: #be123c;
    --franchise-info: #1d4f91;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
}

body {
    margin: 0;
    color: var(--franchise-ink);
    font-family: Arial, Helvetica, sans-serif;
}

button,
input {
    font: inherit;
}

a {
    color: inherit;
}

.franchise-login-page {
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(circle at 14% 10%, rgba(8, 120, 60, 0.08), transparent 35%),
        radial-gradient(circle at 88% 88%, rgba(9, 6, 116, 0.05), transparent 28%),
        #f5f9f6;
}

.franchise-login-layout {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 24px 20px;
    display: grid;
    place-items: center;
}

/* ==============================================================
   2. Main Login Card
   ============================================================== */
.franchise-login-card {
    width: min(100%, 540px);
    padding: 26px 40px 28px;
    border: 1px solid #d5e2d9;
    border-top: 4px solid var(--franchise-theme);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 24px 54px rgba(28, 61, 41, 0.13);
}

.franchise-login-brand {
    width: min(100%, 274px);
    margin: 0 auto 16px;
}

.franchise-login-brand img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.franchise-login-role {
    margin: 0 0 14px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 14px;
}

.franchise-login-role > span {
    height: 1px;
    background: #dbeade;
}

.franchise-login-role b {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #eaf8ee;
    color: var(--franchise-theme);
    font-size: 19px;
}

.franchise-login-card-heading {
    margin-bottom: 27px;
    text-align: center;
}

.franchise-login-card-heading h1 {
    margin: 0 0 8px;
    color: var(--franchise-theme-dark);
    font-size: clamp(28px, 4.5vw, 34px);
    line-height: 1.15;
}

.franchise-login-card-heading p {
    margin: 0;
    color: var(--franchise-muted);
    font-size: 14px;
    line-height: 1.6;
}

/* ==============================================================
   3. Messages and Fields
   ============================================================== */
.franchise-login-message {
    display: none;
    margin-bottom: 12px;
    padding: 10px 11px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.4;
}

.franchise-login-message.is-error {
    display: block;
    border: 1px solid #ef9aa8;
    background: #fff0f2;
    color: var(--franchise-error);
}

.franchise-login-message.is-info {
    display: block;
    border: 1px solid #abc7ef;
    background: #eef5ff;
    color: var(--franchise-info);
}

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

.franchise-form-group label {
    margin-bottom: 8px;
    display: block;
    color: #234d34;
    font-size: 13px;
    font-weight: 700;
}

.franchise-input-with-icon {
    min-height: 54px;
    display: flex;
    align-items: center;
    position: relative;
    border: 1px solid #cddfd2;
    border-radius: 10px;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.franchise-input-with-icon:focus-within {
    border-color: var(--franchise-theme);
    box-shadow: 0 0 0 3px rgba(8, 120, 60, 0.10);
}

.franchise-input-icon {
    width: 44px;
    height: 38px;
    margin-left: 7px;
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    border-radius: 9px;
    background: #edf8f0;
    color: var(--franchise-theme);
    font-size: 15px;
}

.franchise-input-with-icon input {
    width: 100%;
    min-width: 0;
    height: 52px;
    padding: 0 14px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--franchise-ink);
    font-size: 14px;
}

.franchise-input-with-icon input::placeholder {
    color: #94a3b8;
}

.franchise-password-input-wrap input {
    padding-right: 50px;
}

.franchise-password-toggle {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    position: absolute;
    right: 5px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
}

.franchise-password-toggle:hover,
.franchise-password-toggle:focus-visible {
    outline: 0;
    color: var(--franchise-theme);
    background: #eff9f2;
}

.franchise-field-error {
    min-height: 15px;
    margin-top: 5px;
    display: block;
    color: var(--franchise-error);
    font-size: 12px;
}

/* ==============================================================
   4. Options, Action and Help
   ============================================================== */
.franchise-login-options {
    margin: 2px 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.franchise-remember-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #526b5c;
    font-size: 13px;
    cursor: pointer;
}

.franchise-remember-label input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--franchise-theme);
}

.franchise-login-button {
    width: 100%;
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(110deg, var(--franchise-theme-dark), var(--franchise-theme));
    color: #ffffff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 7px 15px rgba(8, 120, 60, 0.16);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.franchise-login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 22px rgba(8, 120, 60, 0.22);
}

.franchise-login-button:active {
    transform: translateY(0);
}

.franchise-login-button:disabled {
    cursor: not-allowed;
    opacity: 0.68;
    transform: none;
    box-shadow: none;
}

.franchise-login-help {
    margin-top: 18px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #d9eee0;
    border-radius: 9px;
    background: #f1fbf4;
    color: #52715e;
    font-size: 11px;
    line-height: 1.35;
}

.franchise-login-help i {
    color: var(--franchise-theme);
}

/* ==============================================================
   5. Responsive Rules
   ============================================================== */
@media (max-width: 479px) {
    .franchise-login-layout {
        padding: 16px 12px;
    }

    .franchise-login-card {
        padding: 20px 10px;
        border-radius: 17px;
    }

    .franchise-login-brand {
        width: min(100%, 150px);
    }

    .franchise-login-card-heading h1 {
        font-size: 27px;
    }

    .franchise-login-options {
        margin-bottom: 16px;
        flex-wrap: nowrap;
        gap: 10px;
    }

    .franchise-login-help {
        margin-top: 14px;
        padding: 8px 10px;
        font-size: 10.5px;
    }
}

@media (min-width: 480px) and (max-width: 767px) {
    .franchise-login-layout {
        padding: 16px 12px;
    }

    .franchise-login-card {
        padding: 24px 21px;
        border-radius: 17px;
    }

    .franchise-login-brand {
        width: min(100%, 245px);
    }
}

/* Very short screens may scroll rather than clipping a control. */
@media (max-height: 559px) {
    .franchise-login-layout {
        align-items: start;
    }
}

/* ==============================================================
   6. Accessibility and Reduced Motion
   ============================================================== */
.franchise-login-button:focus-visible,
.franchise-remember-label input:focus-visible {
    outline: 3px solid rgba(8, 120, 60, 0.24);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* Short-height phones keep the same natural design with tighter spacing. */
@media (max-width: 479px) and (max-height: 640px) {
    .franchise-login-layout {
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .franchise-login-card {
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .franchise-login-brand {
        width: min(100%, 140px);
        margin-bottom: 10px;
    }

    .franchise-login-role {
        margin-bottom: 8px;
    }

    .franchise-login-role b {
        width: 42px;
        height: 42px;
        font-size: 17px;
    }

    .franchise-login-card-heading {
        margin-bottom: 14px;
    }

    .franchise-login-card-heading h1 {
        margin-bottom: 4px;
        font-size: 25px;
    }

    .franchise-login-card-heading p {
        font-size: 12px;
        line-height: 1.35;
    }

    .franchise-form-group {
        margin-bottom: 5px;
    }

    .franchise-form-group label {
        margin-bottom: 5px;
    }

    .franchise-input-with-icon {
        min-height: 50px;
    }

    .franchise-input-with-icon input {
        height: 48px;
    }

    .franchise-field-error {
        min-height: 10px;
        margin-top: 2px;
        font-size: 10.5px;
    }

    .franchise-login-options {
        margin-bottom: 12px;
    }

    .franchise-login-button {
        min-height: 50px;
    }

    .franchise-login-help {
        margin-top: 10px;
        padding: 7px 9px;
        font-size: 10px;
    }

    .franchise-login-message {
        margin-bottom: 8px;
        padding: 7px 9px;
        line-height: 1.3;
    }
}

/* Extra-small phones keep error feedback visible without page overflow. */
@media (max-width: 359px) and (max-height: 579px) {
    .franchise-login-card {
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .franchise-login-role b {
        width: 38px;
        height: 38px;
        font-size: 15px;
    }

    .franchise-login-help {
        margin-top: 6px;
        padding-top: 6px;
        padding-bottom: 6px;
    }
}
