/* =========================================================
   CARGONORA ADMIN LOGIN
========================================================= */

:root {
    --primary: #0b5cff;
    --primary-dark: #0847c7;
    --primary-light: #eaf1ff;

    --dark: #111827;
    --dark-2: #1f2937;
    --text: #344054;
    --muted: #667085;

    --white: #ffffff;
    --background: #f5f7fb;
    --border: #d0d5dd;

    --success: #067647;
    --success-bg: #ecfdf3;

    --danger: #b42318;
    --danger-bg: #fef2f2;

    --shadow: 0 20px 60px rgba(16, 24, 40, 0.12);
}

/* =========================================================
   RESET
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: "Inter", sans-serif;
    color: var(--text);
    background: var(--background);
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

/* =========================================================
   PAGE LAYOUT
========================================================= */

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 52% 48%;
    background: var(--white);
}

/* =========================================================
   LEFT VISUAL PANEL
========================================================= */

.login-visual {
    position: relative;
    min-height: 100vh;
    padding: 48px 60px;
    overflow: hidden;
    color: var(--white);
    background:
        linear-gradient(
            135deg,
            rgba(11, 92, 255, 0.98),
            rgba(6, 55, 157, 0.98)
        );
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.login-visual::before {
    content: "";
    position: absolute;
    width: 520px;
    height: 520px;
    right: -220px;
    top: -180px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
}

.login-visual::after {
    content: "";
    position: absolute;
    width: 720px;
    height: 720px;
    left: -430px;
    bottom: -420px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 50%;
}

.visual-circle {
    position: absolute;
    width: 280px;
    height: 280px;
    right: 12%;
    bottom: 15%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.visual-circle::before,
.visual-circle::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.visual-circle::before {
    width: 190px;
    height: 190px;
    left: 44px;
    top: 44px;
}

.visual-circle::after {
    width: 100px;
    height: 100px;
    left: 89px;
    top: 89px;
}

/* =========================================================
   VISUAL CONTENT
========================================================= */

.login-visual-content {
    position: relative;
    z-index: 2;
    max-width: 620px;
    margin: auto 0;
}

.login-brand {
    position: relative;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 11px;
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -0.6px;
}

.login-brand-icon {
    width: 43px;
    height: 43px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 21px;
}

.login-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.login-brand-text small {
    margin-top: 4px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 1.8px;
    opacity: 0.7;
}

.login-visual-label {
    margin-bottom: 16px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.72);
}

.login-visual h1 {
    max-width: 580px;
    margin-bottom: 22px;
    font-size: clamp(38px, 4vw, 62px);
    line-height: 1.04;
    letter-spacing: -2.5px;
    font-weight: 800;
}

.login-visual-description {
    max-width: 540px;
    font-size: 15px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.78);
}

/* =========================================================
   VISUAL STATS
========================================================= */

.login-visual-stats {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    max-width: 680px;
}

.visual-stat {
    padding: 18px 20px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
}

.visual-stat strong {
    display: block;
    margin-bottom: 5px;
    font-size: 21px;
    font-weight: 800;
    color: var(--white);
}

.visual-stat span {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.65);
}

/* =========================================================
   RIGHT LOGIN PANEL
========================================================= */

.login-panel {
    min-height: 100vh;
    padding: 50px 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
}

.login-box {
    width: 100%;
    max-width: 440px;
}

/* =========================================================
   MOBILE BRAND
========================================================= */

.mobile-login-brand {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 45px;
    color: var(--dark);
}

.mobile-login-brand .brand-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: var(--white);
    background: var(--primary);
}

.mobile-login-brand strong {
    font-size: 20px;
    letter-spacing: -0.5px;
}

.mobile-login-brand small {
    display: block;
    margin-top: 2px;
    font-size: 8px;
    letter-spacing: 1.5px;
    color: var(--muted);
}

/* =========================================================
   LOGIN HEADER
========================================================= */

.login-header {
    margin-bottom: 30px;
}

.login-header .login-label {
    margin-bottom: 10px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--primary);
}

.login-header h2 {
    margin-bottom: 9px;
    color: var(--dark);
    font-size: 31px;
    line-height: 1.2;
    letter-spacing: -1px;
    font-weight: 800;
}

.login-header p {
    font-size: 13px;
    line-height: 1.6;
    color: var(--muted);
}

/* =========================================================
   LOGIN FORM
========================================================= */

.login-form {
    width: 100%;
}

.form-group {
    margin-bottom: 19px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--dark-2);
    font-size: 12px;
    font-weight: 700;
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    height: 50px;
    padding: 0 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    background: var(--white);
    color: var(--dark);
    font-size: 13px;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.input-wrapper input::placeholder {
    color: #98a2b3;
}

.input-wrapper input:hover {
    border-color: #98a2b3;
}

.input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(11, 92, 255, 0.10);
}

/* =========================================================
   PASSWORD INPUT
========================================================= */

.password-wrapper input {
    padding-right: 52px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 13px;
    width: 32px;
    height: 32px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #667085;
    font-size: 15px;
    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.password-toggle:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.password-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* =========================================================
   FORM OPTIONS
========================================================= */

.form-options {
    margin-top: 4px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.remember-me {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
}

.remember-me input {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--primary);
    cursor: pointer;
}

.forgot-password {
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    transition: color 0.2s ease;
}

.forgot-password:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* =========================================================
   LOGIN MESSAGE
========================================================= */

.login-message {
    display: none;
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.5;
    font-weight: 600;
}

.login-message.show {
    display: block;
}

.login-message.error {
    border: 1px solid #fecaca;
    background: var(--danger-bg);
    color: var(--danger);
}

.login-message.success {
    border: 1px solid #abefc6;
    background: var(--success-bg);
    color: var(--success);
}

/* =========================================================
   LOGIN BUTTON
========================================================= */

.login-button {
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    color: var(--white);
    font-size: 13px;
    font-weight: 700;
    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.login-button:hover {
    background: var(--primary-dark);
    box-shadow: 0 7px 18px rgba(11, 92, 255, 0.20);
    transform: translateY(-1px);
}

.login-button:active {
    transform: translateY(0);
}

.login-button:focus-visible {
    outline: 3px solid rgba(11, 92, 255, 0.22);
    outline-offset: 2px;
}

.login-button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
    transform: none;
    box-shadow: none;
}

/* =========================================================
   BACK TO WEBSITE
========================================================= */

.back-to-site {
    margin-top: 25px;
    text-align: center;
}

.back-to-site a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    transition: color 0.2s ease;
}

.back-to-site a:hover {
    color: var(--primary);
}

.back-to-site a span {
    font-size: 14px;
}

/* =========================================================
   SECURITY NOTICE
========================================================= */

.security-notice {
    margin-top: 30px;
    padding: 13px 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    background: #f9fafb;
}

.security-icon {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px;
}

.security-notice p {
    font-size: 9px;
    line-height: 1.55;
    color: var(--muted);
}

.security-notice strong {
    display: block;
    margin-bottom: 2px;
    color: var(--dark-2);
    font-size: 10px;
}

/* =========================================================
   LOADING STATE
========================================================= */

.login-button.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.login-button.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: loginSpinner 0.7s linear infinite;
}

@keyframes loginSpinner {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================================
   RESPONSIVE — TABLET
========================================================= */

@media (max-width: 1100px) {
    .login-page {
        grid-template-columns: 45% 55%;
    }

    .login-visual {
        padding: 40px;
    }

    .login-panel {
        padding: 45px 50px;
    }

    .login-visual h1 {
        font-size: 43px;
    }

    .login-visual-description {
        font-size: 14px;
    }

    .login-visual-stats {
        grid-template-columns: 1fr;
        max-width: 230px;
    }

    .visual-stat {
        padding: 14px 16px;
    }
}

/* =========================================================
   RESPONSIVE — SMALL TABLET
========================================================= */

@media (max-width: 900px) {
    .login-page {
        display: block;
    }

    .login-visual {
        min-height: auto;
        padding: 30px 35px;
    }

    .login-visual-content {
        margin: 70px 0 50px;
    }

    .login-visual h1 {
        max-width: 650px;
        font-size: 40px;
    }

    .login-visual-description {
        max-width: 650px;
    }

    .login-visual-stats {
        max-width: 650px;
        grid-template-columns: repeat(3, 1fr);
    }

    .login-panel {
        min-height: auto;
        padding: 60px 35px 70px;
    }

    .login-box {
        max-width: 480px;
    }
}

/* =========================================================
   RESPONSIVE — MOBILE
========================================================= */

@media (max-width: 650px) {
    .login-visual {
        display: none;
    }

    .login-panel {
        min-height: 100vh;
        padding: 35px 22px;
        align-items: flex-start;
    }

    .login-box {
        max-width: 100%;
    }

    .mobile-login-brand {
        display: flex;
    }

    .login-header {
        margin-bottom: 28px;
    }

    .login-header h2 {
        font-size: 28px;
    }

    .login-header p {
        font-size: 12px;
    }

    .form-group {
        margin-bottom: 17px;
    }

    .form-options {
        margin-bottom: 20px;
    }

    .security-notice {
        margin-top: 25px;
    }
}

/* =========================================================
   RESPONSIVE — SMALL MOBILE
========================================================= */

@media (max-width: 420px) {
    .login-panel {
        padding: 28px 18px 45px;
    }

    .mobile-login-brand {
        margin-bottom: 38px;
    }

    .login-header h2 {
        font-size: 26px;
    }

    .login-header p {
        font-size: 11px;
    }

    .input-wrapper input,
    .login-button {
        height: 48px;
    }

    .form-options {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .forgot-password {
        align-self: flex-start;
    }

    .security-notice {
        padding: 12px;
    }
}

/* =========================================================
   ACCESSIBILITY
========================================================= */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
