﻿/* ============================================================
   Login Page — Order De In Janab Admin
   Split-screen layout: branding panel (left) + login card (right).
   Built with CSS variables so the color theme is adjustable from
   one place without hunting through the whole file.
   ============================================================ */

:root {
    --odj-green: #1b8a4b;
    --odj-green-dark: #146238;
    --odj-orange: #ff7a1a;
    --odj-orange-light: #ffa564;
    --odj-white: #ffffff;
    --odj-gray-light: #f4f6f5;
    --odj-gray-mid: #8a9690;
    --odj-text-dark: #1c2b22;
    --odj-danger: #d6364a;
    --odj-success: #1b8a4b;
    --odj-warning: #ff7a1a;
    --odj-radius-lg: 20px;
    --odj-radius-md: 12px;
    --odj-shadow-soft: 0 20px 60px rgba(20, 40, 30, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--odj-gray-light);
    color: var(--odj-text-dark);
}

/* ---------- Overall split shell ---------- */

.login-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ---------- Left: Branding panel ---------- */

.login-brand-panel {
    position: relative;
    flex: 1.1;
    background: linear-gradient(135deg, var(--odj-green) 0%, var(--odj-green-dark) 100%);
    color: var(--odj-white);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 48px;
}

.brand-panel-inner {
    position: relative;
    z-index: 2;
    max-width: 480px;
    width: 100%;
    animation: fadeInUp 0.7s ease-out both;
}

.brand-logo-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 48px;
    animation: fadeIn 0.6s ease-out both;
}

.brand-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    padding: 4px;
}

.brand-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.brand-hero-text {
    margin-bottom: 36px;
}

.brand-headline {
    font-size: 42px;
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 16px 0;
}

.brand-subline {
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    max-width: 380px;
}

.brand-hero-image-wrap {
    margin-bottom: 40px;
}

.brand-hero-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--odj-radius-md);
    /* Intentionally no shadow/frame here — if the real illustration has
       its own background, an extra card frame around it usually looks
       worse, not better. Add one back if the actual asset needs it. */
}

.brand-footer p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

/* Decorative background shapes — pure CSS, no image asset dependency,
   purely so the left panel doesn't feel flat before the real hero image
   is in place. Subtle and low-opacity per the spec's "avoid excessive
   animation" guidance. */

.brand-bg-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    z-index: 1;
}

.brand-bg-shape-1 {
    width: 420px;
    height: 420px;
    top: -120px;
    right: -140px;
}

.brand-bg-shape-2 {
    width: 280px;
    height: 280px;
    bottom: -100px;
    left: -80px;
    background: rgba(255, 122, 26, 0.12); /* orange accent, very subtle */
}

/* ---------- Right: Login form panel ---------- */

.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: var(--odj-gray-light);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--odj-radius-lg);
    box-shadow: var(--odj-shadow-soft);
    padding: 40px 36px;
    animation: cardEntrance 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.login-card-header {
    margin-bottom: 28px;
    text-align: left;
}

.login-title {
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 6px 0;
    color: var(--odj-text-dark);
}

.login-subtitle {
    font-size: 14px;
    color: var(--odj-gray-mid);
    margin: 0;
}

/* ---------- Alerts ---------- */

.login-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--odj-radius-md);
    font-size: 13.5px;
    margin-bottom: 20px;
    animation: alertSlideIn 0.25s ease-out both;
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-alert-danger {
    background: rgba(214, 54, 74, 0.08);
    color: var(--odj-danger);
    border: 1px solid rgba(214, 54, 74, 0.18);
}

/* ---------- Floating-label inputs ---------- */

.floating-field {
    position: relative;
}

.floating-input {
    width: 100%;
    height: 52px;
    padding: 20px 16px 6px 44px;
    border: 1.5px solid #e1e6e3;
    border-radius: var(--odj-radius-md);
    font-size: 15px;
    background: var(--odj-white);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    outline: none;
}

    .floating-input:focus {
        border-color: var(--odj-green);
        box-shadow: 0 0 0 3px rgba(27, 138, 75, 0.12);
    }

.field-icon {
    position: absolute;
    left: 16px;
    top: 26px;
    color: var(--odj-gray-mid);
    font-size: 15px;
    transition: color 0.18s ease;
    pointer-events: none;
}

.floating-input:focus ~ .field-icon,
.floating-field:focus-within .field-icon {
    color: var(--odj-green);
}

.floating-label {
    position: absolute;
    left: 44px;
    top: 16px;
    font-size: 15px;
    color: var(--odj-gray-mid);
    transition: all 0.16s ease;
    pointer-events: none;
    background: transparent;
}

/* Floating label moves up when the input is focused OR already has a
   value — the ":placeholder-shown" trick lets pure CSS detect "has
   content" without any JS, since the input's placeholder is a single
   blank space (see placeholder=" " in the markup). */
.floating-input:focus + .floating-label,
.floating-input:not(:placeholder-shown) + .floating-label {
    top: 6px;
    font-size: 11.5px;
    color: var(--odj-green);
    font-weight: 600;
}

.password-toggle-btn {
    position: absolute;
    right: 14px;
    top: 14px;
    background: none;
    border: none;
    color: var(--odj-gray-mid);
    font-size: 15px;
    cursor: pointer;
    padding: 6px;
}

    .password-toggle-btn:hover {
        color: var(--odj-text-dark);
    }

.field-error-text {
    display: block;
    font-size: 12.5px;
    color: var(--odj-danger);
    margin-top: 5px;
    margin-left: 4px;
}

/* Error state: when ASP.NET's validator marks a field invalid, it adds
   no class to the input itself by default — this is a deliberately
   light-touch addition: if you want the FIELD border to flag red as
   well as the message below it, add cssClass handling on the
   validator's ClientID via a tiny JS hook later. Left out for now to
   avoid overcomplicating the first pass. */

/* ---------- Remember me + options row ---------- */

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 18px 0 22px 0;
}

.remember-me-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: var(--odj-text-dark);
    cursor: pointer;
    user-select: none;
}

    .remember-me-check input[type="checkbox"] {
        width: 16px;
        height: 16px;
        accent-color: var(--odj-green);
        cursor: pointer;
    }

/* ---------- Login button ---------- */

.btn-login {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: var(--odj-radius-md);
    background: linear-gradient(135deg, var(--odj-green) 0%, var(--odj-orange) 130%);
    color: var(--odj-white);
    font-size: 15.5px;
    font-weight: 700;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    box-shadow: 0 8px 20px rgba(27, 138, 75, 0.25);
}

    .btn-login:hover:not(:disabled) {
        transform: translateY(-1px);
        box-shadow: 0 10px 24px rgba(27, 138, 75, 0.32);
    }

    .btn-login:active:not(:disabled) {
        transform: translateY(0);
    }

    .btn-login:disabled {
        opacity: 0.75;
        cursor: not-allowed;
    }

/* Loading state: applied via JS (login.js) by adding this class to the
   submit input right before the real PostBack fires. An <input
   type="submit"> can't contain child HTML, so the spinner is rendered as
   a ::before pseudo-element rather than an injected <span> — this is why
   the class adds extra left padding (room for the spinner) instead of
   the JS building real markup inside the button. */
.btn-login-loading {
    position: relative;
    padding-left: 38px;
}

    .btn-login-loading::before {
        content: '';
        position: absolute;
        left: 14px;
        top: 50%;
        width: 16px;
        height: 16px;
        margin-top: -8px;
        border: 2px solid rgba(255, 255, 255, 0.4);
        border-top-color: var(--odj-white);
        border-radius: 50%;
        animation: spin 0.7s linear infinite;
    }

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.login-footer-note {
    text-align: center;
    margin-top: 22px;
    font-size: 12.5px;
    color: var(--odj-gray-mid);
}

    .login-footer-note i {
        margin-right: 6px;
        color: var(--odj-green);
    }

/* ============================================================
   Mobile responsiveness
   ============================================================ */

@media (max-width: 900px) {
    .login-shell {
        flex-direction: column;
    }

    .login-brand-panel {
        flex: none;
        padding: 32px 24px;
        min-height: 280px;
    }

    .brand-headline {
        font-size: 30px;
    }

    .brand-hero-image-wrap {
        display: none; /* hide the hero illustration on small screens to save vertical space — the form should be reachable without excessive scrolling */
    }

    .login-form-panel {
        padding: 24px 20px 40px;
    }

    .login-card {
        padding: 32px 24px;
        box-shadow: none; /* on mobile, the card visually IS the page — a heavy shadow looks odd full-width */
        background: var(--odj-white);
        backdrop-filter: none;
    }
}

@media (max-width: 420px) {
    .brand-headline {
        font-size: 26px;
    }

    .login-title {
        font-size: 22px;
    }
}

/* ---------- Accessibility ---------- */

.floating-input:focus-visible,
.btn-login:focus-visible,
.password-toggle-btn:focus-visible {
    outline: 2px solid var(--odj-orange);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
