/* ========================================
   RESET & GLOBAL STYLES
======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        sans-serif;
    background: #f8fafc;
    margin: 0;
    overflow: auto;
    min-height: 100vh;
}

/* ========================================
   MAIN WRAPPER - FULL SCREEN SPLIT
======================================== */

.login-wrapper {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* ========================================
   LEFT SECTION - 50% WIDTH
======================================== */

.left-section {
    flex: 1;
    background: linear-gradient(135deg, #097e93 0%, #055968 100%);
    display: flex;
    flex-direction: column;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.left-section::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.1) 1px,
        transparent 1px
    );
    background-size: 50px 50px;
    animation: moveGrid 20s linear infinite;
    z-index: 1;
}

.left-section::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    padding-bottom: 0;
    background: url("/assets/img/pages/bg_login.png") no-repeat center bottom;
    background-size: 100% auto;
    opacity: 0.6;
    z-index: 2;
    aspect-ratio: auto;
    min-height: 100%;
    mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 0, 0, 0.3) 30%,
        rgba(0, 0, 0, 0.7) 60%,
        rgba(0, 0, 0, 1) 100%
    );
    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 0, 0, 0.3) 30%,
        rgba(0, 0, 0, 0.7) 60%,
        rgba(0, 0, 0, 1) 100%
    );
}

@keyframes moveGrid {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

.left-content {
    position: relative;
    z-index: 3;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Logo Header */
.logo-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    gap: 12px;
    padding: 30px 40px 0;
    animation: fadeInDown 0.8s ease-out;
}

.logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.logo-text {
    text-align: center;
}

.app-title {
    color: white;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.app-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 500;
    margin: 2px 0 0 0;
}

/* Description Text - Centered */
.description-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    margin-top: -350px;
    animation: fadeInUp 0.8s ease-out 0.5s both;
    @media (max-width: 1024px) {
        margin-top: 0;
    }
}

.welcome-title {
    color: white;
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 0;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    letter-spacing: -1px;
    line-height: 1.2;
}

.welcome-desc {
    color: rgba(255, 255, 255, 0.95);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.6;
    max-width: 90%;
    margin: 0 auto;
}

/* ========================================
   RIGHT SECTION - 50% WIDTH
======================================== */

.right-section {
    flex: 1;
    background: white;
    display: flex;
    flex-direction: column;
    position: relative;
}

.right-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    animation: fadeInRight 0.8s ease-out;
}

/* Form Header */
.form-header {
    text-align: center;
    margin-bottom: 40px;
    width: 100%;
    max-width: 400px;
}

.form-title {
    color: #1e293b;
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -1px;
}

.form-subtitle {
    color: #64748b;
    font-size: 15px;
    font-weight: 400;
}

/* ========================================
   LOGIN FORM
======================================== */

.login-form {
    width: 100%;
    max-width: 420px;
}

/* Form Field Container */
.form-field {
    margin-bottom: 20px;
}

/* Field Label */
.field-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1e293b;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.field-label i {
    font-size: 18px;
    color: #097e93;
}

/* Field Input Container */
.field-input {
    position: relative;
    width: 100%;
}

/* Input Control */
.input-control {
    width: 100%;
    padding: 15px 18px;
    font-size: 15px;
    font-family: inherit;
    color: #1e293b;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.input-control::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.input-control:hover {
    border-color: #cbd5e1;
}

.input-control:focus {
    border-color: #097e93;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(9, 126, 147, 0.08);
}

.input-control.input-invalid {
    border-color: #ef4444;
    background: #fef2f2;
}

.input-control.input-invalid:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Password Field */
.password-field {
    position: relative;
}

.password-field .input-control {
    padding-right: 50px;
}

/* Toggle Password Button */
.toggle-password {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    transition: all 0.3s ease;
    outline: none;
}

.toggle-password i {
    font-size: 20px;
    transition: transform 0.2s ease;
}

.toggle-password:hover {
    color: #097e93;
}

.toggle-password:hover i {
    transform: scale(1.1);
}

.toggle-password:active i {
    transform: scale(0.95);
}

/* Field Error */
.field-error {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #ef4444;
    font-size: 13px;
    font-weight: 500;
    margin-top: 8px;
    animation: slideDown 0.3s ease;
}

.field-error i {
    font-size: 16px;
    flex-shrink: 0;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Row */
.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #64748b;
    font-size: 14px;
}

.checkbox-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #097e93;
}

.link-forgot {
    color: #097e93;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.link-forgot:hover {
    color: #055968;
}

/* Alert Box */
.alert-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    color: #dc2626;
    font-size: 14px;
    margin-bottom: 24px;
    animation: shake 0.5s ease;
}

.alert-box i {
    font-size: 20px;
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* Submit Button */
.btn-submit {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #097e93 0%, #055968 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(9, 126, 147, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-submit::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.5s ease;
}

.btn-submit:hover::before {
    left: 100%;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(9, 126, 147, 0.5);
}

.btn-submit:active {
    transform: translateY(0);
}

/* Button Content States */
.button-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.button-content i {
    font-size: 22px;
}

/* Loading State */
.loading-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Form Footer */
.form-footer {
    margin-top: 28px;
    text-align: center;
    font-size: 14px;
    color: #64748b;
}

.link-contact {
    color: #097e93;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.link-contact:hover {
    color: #055968;
}

/* Copyright */
.copyright {
    padding: 20px;
    text-align: center;
    border-top: 1px solid #e2e8f0;
    font-size: 13px;
    color: #64748b;
}

.copyright a {
    color: #097e93;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.copyright a:hover {
    color: #055968;
}

/* ========================================
   ANIMATIONS
======================================== */

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ========================================
   RESPONSIVE DESIGN
======================================== */

@media (max-width: 1024px) {
    body {
        overflow: auto;
    }

    .login-wrapper {
        min-height: 100vh;
        height: auto;
        flex-direction: column;
    }

    .left-section {
        min-height: 50vh;
    }

    .left-content {
        min-height: 50vh;
    }

    .right-section {
        padding: 40px;
    }

    .right-content {
        padding: 40px;
    }

    .welcome-title {
        font-size: 36px;
    }

    .welcome-desc {
        font-size: 16px;
    }

    .form-title {
        font-size: 32px;
    }
}

@media (max-width: 768px) {
    body {
        overflow: auto;
        height: auto;
    }

    .login-wrapper {
        flex-direction: column;
        overflow: visible;
        height: auto;
        min-height: 100vh;
    }

    .left-section {
        min-height: 50vh;
        padding: 0;
    }

    .left-content {
        min-height: 50vh;
    }

    .logo-header {
        padding: 20px 30px 0;
    }

    .logo {
        width: 50px;
        height: 50px;
    }

    .app-title {
        font-size: 16px;
    }

    .app-subtitle {
        font-size: 12px;
    }

    .description-text {
        padding: 30px;
    }

    .welcome-title {
        font-size: 32px;
    }

    .welcome-desc {
        font-size: 15px;
    }

    .right-section {
        min-height: auto;
    }

    .right-content {
        padding: 40px 20px;
        min-height: auto;

        .form-subtitle {
            font-size: 14px;
        }
    }

    @media (max-width: 480px) {
        body {
            overflow: auto;
        }

        .logo-header {
            flex-direction: column;
            gap: 10px;
            padding: 20px 20px 0;
        }

        .logo {
            width: 45px;
            height: 45px;
        }

        .logo-text {
            text-align: center;
        }

        .app-title {
            font-size: 15px;
        }

        .app-subtitle {
            font-size: 11px;
        }

        .description-text {
            padding: 20px;
        }

        .welcome-title {
            font-size: 28px;
        }

        .welcome-desc {
            font-size: 14px;
        }
    }

    .form-title {
        font-size: 24px;
    }

    .form-row {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .input-field {
        padding: 12px 45px;
        font-size: 14px;
    }

    .btn-submit {
        padding: 14px;
        font-size: 15px;
    }
}
