/* =========================================================
   AYKAR BUSINESS MANAGEMENT
   LOGIN SCREEN
========================================================= */


/* =========================
   GLOBAL
========================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    min-height: 100%;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #0f172a;
    background: #f8fafc;
}


/* =========================
   MAIN LAYOUT (ERP MODERN THEME)
========================= */

.login-page {
    position: relative;

    width: 100%;
    min-height: 100vh;

    display: grid;
    grid-template-columns: minmax(380px, 440px) 1fr;
    align-items: stretch;

    gap: 0;

    padding: 0;

    overflow: hidden;

    background: #f8fafc;
}

.login-page::before,
.login-page::after {
    display: none;
}


/* =========================================================
   LEFT BRAND PANEL (AYKAR BRAND NAVY #101b38)
========================================================= */

.brand-panel {
    position: relative;
    z-index: 1;

    min-height: 100vh;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    padding: 48px;

    overflow: visible;

    background: #101b38;
    border-right: 1px solid #1e293b;
    box-shadow: 4px 0 24px rgba(16, 27, 56, 0.12);
}


/* =========================
   LOGO
========================= */

.brand-top {
    position: relative;
    z-index: 2;

    top: 0;
    left: 0;

    width: auto;
    height: auto;

    margin: 0;
}

.brand-logo {
    display: block;

    width: auto;
    max-width: 250px;
    height: 58px;

    object-fit: contain;
    object-position: left center;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}


/* =========================
   LEFT CONTENT
========================= */

.brand-content {
    position: relative;
    z-index: 2;

    max-width: 380px;

    margin: auto 0;
    padding: 40px 0;
}

.brand-content h1 {
    margin: 0;

    color: #ffffff;

    font-size: clamp(38px, 3.5vw, 48px);
    line-height: 1.12;

    letter-spacing: -1.2px;

    font-weight: 700;
}

.brand-line {
    width: 56px;
    height: 4px;

    margin: 24px 0 20px;

    border-radius: 8px;

    background: #3b82f6;
    opacity: 0.95;
}

.brand-content p {
    max-width: 340px;

    margin: 0;

    color: #f1f5f9;

    font-size: 16px;
    line-height: 1.65;
    opacity: 0.95;
}


/* =========================
   LEFT FOOTER
========================= */

.brand-footer {
    position: relative;
    z-index: 2;

    left: 0;
    bottom: 0;

    color: #94a3b8;

    font-size: 13px;

    letter-spacing: 0.4px;
}


/* =========================================================
   RIGHT LOGIN PANEL (CLEAN SLATE #f8fafc)
========================================================= */

.login-panel {
    position: relative;
    z-index: 1;

    min-height: 100vh;
    align-self: stretch;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 48px 24px;

    background: #f8fafc;
}


/* =========================
   TOP CONTROLS & ENVIRONMENT SWITCHER
========================= */

.top-controls-wrapper {
    position: absolute;
    top: 24px;
    right: 28px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 12px;
}

.env-toggle {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 3px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.env-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.env-chip:hover {
    color: #0f172a;
}

.env-chip.active {
    background: #e2e8f0;
    color: #0f172a;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.env-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.env-dot.prod {
    background: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.env-dot.stage {
    background: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
}

.language-wrapper {
    position: relative;
    top: 0;
    right: 0;
    z-index: 3;
}

.language-wrapper select {
    min-width: 130px;

    padding: 10px 38px 10px 14px;

    border: 1px solid #dfd4c7;
    border-radius: 10px;

    outline: none;

    background: #ffffff;

    color: #2f3a3e;

    font-size: 14px;
    font-weight: 500;

    cursor: pointer;

    box-shadow: 0 4px 14px rgba(47, 58, 62, 0.05);

    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

.language-wrapper select:hover,
.language-wrapper select:focus {
    border-color: #78898f;

    box-shadow:
        0 0 0 3px rgba(120, 137, 143, 0.18);
}


/* =========================
   LOGIN CONTAINER
========================= */

.login-container {
    width: 100%;
    max-width: 440px;

    padding: 42px 38px 36px;

    border: 1px solid #dfd4c7;
    border-radius: 20px;

    background: #ffffff;

    box-shadow:
        0 14px 38px rgba(47, 58, 62, 0.07),
        0 2px 8px rgba(47, 58, 62, 0.03);
}

.mobile-logo {
    display: none;
    margin-bottom: 24px;
}

.mobile-logo img {
    max-width: 220px;
    height: 48px;
    object-fit: contain;
}

.welcome-label {
    margin: 0 0 12px;

    color: #78898f;

    font-size: 13px;
    font-weight: 800;

    letter-spacing: 2.2px;
}

.login-container h2,
.signup-card h2 {
    margin: 0 0 10px;

    background: linear-gradient(135deg, #1e40af 0%, #2563eb 45%, #059669 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;

    font-size: 30px;
    line-height: 1.2;

    letter-spacing: -0.6px;
    font-weight: 700;
}

html[data-theme="dark"] .login-container h2,
html[data-theme="dark"] .signup-card h2 {
    background: linear-gradient(135deg, #60a5fa 0%, #38bdf8 50%, #34d399 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
}

.login-description {
    margin: 0 0 32px;

    color: #5d6c72;

    font-size: 15px;
    line-height: 1.55;
}


/* =========================================================
   FLOATING LABEL INPUTS
========================================================= */

.floating-field {
    position: relative;

    width: 100%;

    height: 56px;

    margin-bottom: 16px;
}

.floating-field input {
    box-sizing: border-box;

    width: 100%;
    height: 56px;

    padding: 22px 18px 8px;

    border: 1.5px solid #dfd4c7;
    border-radius: 12px;

    outline: none;

    background: #fbf8f4;

    color: #2f3a3e;

    font: inherit;
    font-size: 15px;
    font-weight: 500;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}


/* DEFAULT LABEL POSITION */

.floating-field label {
    position: absolute;

    left: 18px;
    top: 50%;

    color: #708086;

    font-size: 14px;
    font-weight: 500;

    pointer-events: none;

    transform: translateY(-50%);
    transform-origin: left center;

    transition:
        top 0.2s ease,
        transform 0.2s ease,
        font-size 0.2s ease,
        color 0.2s ease,
        font-weight 0.2s ease;
}


/* LABEL FLOATS ABOVE THE TYPED TEXT */

.floating-field input:focus + label,
.floating-field input:not(:placeholder-shown) + label {
    top: 11px;

    color: #78898f;

    font-size: 11px;
    font-weight: 700;

    transform: translateY(0);
}


/* ACTIVE BOX */

.floating-field input:focus {
    border-color: #78898f;

    background: #ffffff;

    box-shadow: 0 0 0 3px rgba(120, 137, 143, 0.18);
}


/* BROWSER AUTOFILL */

.floating-field input:-webkit-autofill {
    border-radius: 12px;
    -webkit-box-shadow: 0 0 0 1000px #fbf8f4 inset;
}

.floating-field input:-webkit-autofill + label {
    top: 11px;

    color: #78898f;

    font-size: 11px;
    font-weight: 700;

    transform: translateY(0);
}


/* =========================================================
   PASSWORD BUTTON
========================================================= */

.password-field input {
    padding-right: 72px;
}

.show-password {
    position: absolute;

    right: 14px;
    top: 50%;

    z-index: 3;

    padding: 4px 6px;

    border: none;

    background: transparent;

    color: #78898f;

    font-size: 13px;
    font-weight: 700;

    cursor: pointer;

    transform: translateY(-50%);
    transition: color 0.2s ease;
}

.show-password:hover {
    color: #5c6c72;
}


/* =========================================================
   LOGIN OPTIONS
========================================================= */

.login-options {
    display: flex;

    justify-content: space-between;
    align-items: center;

    gap: 16px;

    margin-top: 10px;
    margin-bottom: 28px;
}


/* =========================
   REMEMBER ME
========================= */

.remember-wrapper {
    position: relative;

    display: flex;

    align-items: center;

    gap: 10px;

    color: #4e5c62;

    font-size: 14px;
    font-weight: 500;

    cursor: pointer;

    user-select: none;
}

.remember-wrapper input {
    position: absolute;

    opacity: 0;

    pointer-events: none;
}

.custom-checkbox {
    width: 19px;
    height: 19px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border: 1.5px solid #cbbeaf;
    border-radius: 6px;

    background: #ffffff;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.remember-wrapper:hover .custom-checkbox {
    border-color: #78898f;
}

.remember-wrapper input:checked + .custom-checkbox {
    border-color: #78898f;

    background: #78898f;

    box-shadow:
        0 2px 6px rgba(120, 137, 143, 0.25);
}

.remember-wrapper input:checked + .custom-checkbox::after {
    content: "✓";

    color: #ffffff;

    font-size: 12px;
    font-weight: 800;
}


/* =========================
   FORGOT PASSWORD
========================= */

.forgot-password {
    color: #78898f;

    font-size: 14px;
    font-weight: 600;

    text-decoration: none;

    transition: color 0.2s ease;
}

.forgot-password:hover {
    color: #5c6c72;
    text-decoration: underline;
}


/* =========================================================
   SIGN IN BUTTON
========================================================= */

.login-button {
    width: 100%;
    min-height: 54px;

    display: flex;

    align-items: center;
    justify-content: space-between;

    padding: 8px 14px 8px 24px;

    border: 1px solid #6c7d83;
    border-radius: 12px;

    background: #78898f;

    color: #ffffff;

    font-size: 16px;
    font-weight: 600;

    cursor: pointer;

    box-shadow:
        0 6px 18px rgba(120, 137, 143, 0.28);

    transition:
        all 0.2s ease;
}

.login-button:hover {
    background: #63757b;
    border-color: #57696f;
    transform: translateY(-2px);

    box-shadow:
        0 10px 24px rgba(120, 137, 143, 0.36);
}

.login-button:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(120, 137, 143, 0.24);
}

.button-arrow {
    width: 36px;
    height: 36px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background: rgba(255, 255, 255, 0.22);

    color: #ffffff;

    font-size: 18px;

    transition: transform 0.25s ease, background 0.2s ease;
}

.login-button:hover .button-arrow {
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.32);
}


/* =========================================================
   SECURE ACCESS
========================================================= */

.secure-access {
    display: flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    margin-top: 28px;

    color: #708086;

    font-size: 13px;
    font-weight: 500;
}

.secure-dot {
    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: #10b981;

    box-shadow:
        0 0 0 3px rgba(16, 185, 129, 0.2);
}

.signup-link {
    margin-top: 24px;
    text-align: center;
}

.signup-link p {
    margin: 0;
    color: #5d6c72;
    font-size: 14px;
}

.signup-link a {
    color: #78898f;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.signup-link a:hover {
    color: #5c6c72;
    text-decoration: underline;
}


/* =========================================================
   TABLET
========================================================= */

@media screen and (max-width: 1000px) {

    .login-page {
        grid-template-columns: minmax(320px, 380px) 1fr;
        gap: 0;
        padding: 0;
    }

    .brand-panel {
        padding: 36px 28px;
    }

    .brand-logo {
        width: auto;
        max-width: 220px;
        height: 50px;
    }

    .brand-content h1 {
        font-size: 36px;
    }

    .login-container {
        padding: 36px 28px 28px;
    }

}


/* =========================================================
   MOBILE
========================================================= */

@media screen and (max-width: 768px) {

    .login-page {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;

        gap: 0;

        min-height: 100vh;

        padding: 0;
        background: #f8fafc;
    }

    .brand-panel {
        display: none !important;
    }

    .env-toggle,
    #envToggleContainer {
        display: none !important;
    }

    .mobile-logo {
        display: block !important;
        margin: 0 auto 20px !important;
        text-align: center !important;
    }

    .mobile-logo img {
        max-width: 175px !important;
        height: auto !important;
        margin: 0 auto !important;
    }

    .brand-top {
        position: static;
        margin-bottom: 16px;
    }

    .brand-logo {
        width: auto;
        max-width: 200px;
        height: 46px;
    }

    .brand-content {
        margin: 0;
        padding: 10px 0;
    }

    .brand-footer {
        display: none;
    }

    .brand-content h1 {
        font-size: 28px;
        letter-spacing: -0.8px;
    }

    .brand-line {
        margin: 16px 0 12px;
    }

    .brand-content p {
        font-size: 14px;
    }

    .login-panel {
        position: relative;
        align-self: stretch;
        min-height: auto;

        padding: 36px 20px 48px;
        background: #f8fafc;
    }

    .top-controls-wrapper {
        top: 16px;
        right: 16px;
    }

    .language-wrapper select {
        min-width: 115px;

        padding-top: 8px;
        padding-bottom: 8px;
    }

    .login-container {
        max-width: 440px;

        padding: 32px 24px 26px;
    }

    .mobile-logo {
        display: none;
    }

    .login-container h2 {
        font-size: 28px;
    }

    .login-description {
        margin-bottom: 28px;
    }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media screen and (max-width: 420px) {

    .login-panel {
        padding: 0;
    }

    .language-wrapper {
        top: 20px;
        right: 20px;
    }

    .mobile-logo {
        margin-bottom: 34px;
    }

    .mobile-logo img {
        width: auto;
        max-width: 195px;
        height: 44px;
    }

    .welcome-label {
        font-size: 12px;

        letter-spacing: 2.5px;
    }

    .login-container h2 {
        font-size: 29px;
    }

    .login-description {
        font-size: 15px;
    }

    .login-options {
        gap: 14px;
    }

    .remember-wrapper,
    .forgot-password {
        font-size: 13px;
    }

}
/* =========================================================
   SIGN IN ARROW CLICK ANIMATION
========================================================= */

.login-button {
    position: relative;
    overflow: hidden;
}

/* Arrow normal state */
.login-button .button-arrow {
    position: relative;
    z-index: 3;
}

/* Animation starts when button receives this class */
.login-button.is-signing-in .button-arrow {
  animation: aykarArrowTravel 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Subtle light sweep across button */
.login-button.is-signing-in::after {
    content: "";
    position: absolute;

    top: 0;
    left: -45%;

    width: 35%;
    height: 100%;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.18),
        transparent
    );

    transform: skewX(-20deg);

    animation: aykarButtonLight 1.5s ease;
}

/* Arrow travels from left to right */
@keyframes aykarArrowTravel {

    0% {
        transform: translateX(0);
        opacity: 1;
    }

    18% {
        transform: translateX(-390px);
        opacity: 0;
    }

    19% {
        transform: translateX(-390px);
        opacity: 1;
    }

    82% {
        transform: translateX(0);
        opacity: 1;
    }

    92% {
        transform: translateX(5px);
    }

    100% {
        transform: translateX(0);
    }
}

/* Light travelling through button */
@keyframes aykarButtonLight {

    0% {
        left: -45%;
    }

    100% {
        left: 120%;
    }
}

/* Prevent hover animation from interfering during click */
.login-button.is-signing-in:hover .button-arrow {
    transform: none;
}

/* ==========================================
   WELCOME MODAL — SUCCESSFUL LOGIN
========================================== */

.welcome-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(7, 18, 42, 0.65);
    backdrop-filter: blur(7px);
    animation: welcomeFadeIn 0.3s ease-out;
}

.welcome-card {
    width: 100%;
    max-width: 420px;
    padding: 48px 32px 36px;
    border-radius: 24px;
    background: #ffffff;
    text-align: center;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
    animation: welcomeCardIn 0.45s ease-out;
}

.welcome-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    margin: 0 auto 26px;
    border: 3px solid #2478ff;
    border-radius: 50%;
    color: #2478ff;
    font-size: 38px;
    font-weight: 700;
    animation: welcomeCheckIn 0.6s ease-out;
}

.welcome-card h2 {
    margin: 0 0 12px;
    color: #101b38;
    font-size: 27px;
    font-weight: 700;
}

.welcome-card p {
    margin: 0;
    color: #66728a;
    font-size: 15px;
}

.welcome-progress {
    height: 4px;
    margin-top: 32px;
    overflow: hidden;
    border-radius: 10px;
    background: #e8eef9;
}

.welcome-progress::after {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #1769ff, #28c7ff);
    transform-origin: left;
    animation: welcomeProgress 1.8s linear forwards;
}

@keyframes welcomeFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes welcomeCardIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes welcomeCheckIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes welcomeProgress {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
    .login-page::before,
    .login-page::after,
    .welcome-overlay,
    .welcome-card,
    .welcome-check,
    .welcome-progress::after,
    .login-button.is-signing-in .button-arrow,
    .login-button.is-signing-in::after {
        animation: none;
    }

    .login-button:hover,
    .login-button:hover .button-arrow {
        transform: none;
    }
}

.login-container.is-signup {
    max-width: 520px;
    max-height: min(780px, calc(100vh - 48px));
    overflow: auto;
    padding: 28px 28px 22px;
    background: #ffffff;
    color: #071a2f;
}

.login-container.is-signup > .welcome-label,
.login-container.is-signup > h2,
.login-container.is-signup > .login-description,
.login-container.is-signup > .signup-link {
    display: none;
}

.signup-card h2 {
    margin: 0 0 8px;
    color: #071a2f;
    font-size: 32px;
    line-height: 1.15;
    letter-spacing: -0.6px;
}

.signup-kicker {
    margin: 0 0 8px;
    color: #78898f;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.signup-lead,
.signup-switch {
    margin: 0 0 18px;
    color: #5d6c72;
    font-size: 14px;
    line-height: 1.5;
}

.signup-switch {
    margin: 14px 0 0;
}

.signup-switch a,
.signup-card a {
    color: #78898f;
    font-weight: 700;
    text-decoration: none;
}

.signup-section {
    margin: 0 0 8px;
    padding: 0;
    border: 0;
}

.signup-section legend {
    margin-bottom: 8px;
    color: #78898f;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.signup-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.signup-field label {
    color: #536273;
    font-size: 12px;
    font-weight: 700;
}

.signup-optional {
    color: #8aa0b8;
    font-weight: 600;
}

.signup-field input {
    width: 100%;
    padding: 8px 0;
    border: 0;
    border-bottom: 1px solid #d5e0ec;
    border-radius: 0;
    outline: none;
    background: transparent;
    color: #2f3a3e;
    font: inherit;
    font-size: 15px;
}

.signup-field input:focus {
    border-bottom: 2px solid #78898f;
}

.signup-card .login-button {
    width: 100%;
    margin-top: 6px;
}

#signupMessage {
    min-height: 1.2em;
    margin: 12px 0 0;
    color: #0f766e;
    font-size: 13px;
    line-height: 1.45;
}

html[data-theme="dark"] .login-container.is-signup,
html[data-theme="dark"] .signup-card {
    background: #ffffff;
    color: #071a2f;
}

html[data-theme="dark"] .signup-card h2,
html[data-theme="dark"] .login-container.is-signup h2,
html[data-theme="dark"] .signup-field label,
html[data-theme="dark"] .signup-lead,
html[data-theme="dark"] .signup-switch {
    color: #071a2f;
}

html[data-theme="dark"] .signup-lead,
html[data-theme="dark"] .signup-switch,
html[data-theme="dark"] .signup-field label {
    color: #536273;
}

html[data-theme="dark"] .signup-card input {
    background: transparent;
    color: #071a2f;
    border-color: #d5e0ec;
}

/* =========================================================
   LOGIN SECURITY FIREWALL & LOCKOUT UI
========================================================= */

.login-button:disabled {
    background: #94a3b8 !important;
    border-color: #64748b !important;
    color: #f8fafc !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.85;
}

.login-notice-security {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    line-height: 1.45;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.login-notice-security.is-locked {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.login-notice-security.is-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.login-notice-security.is-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.login-countdown-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #fee2e2;
    border-radius: 6px;
    font-weight: 700;
    font-family: monospace;
    font-size: 14px;
    color: #b91c1c;
    letter-spacing: 0.5px;
}