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

html {
    height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: 
        linear-gradient(160deg, rgba(26, 94, 74, 0.85) 0%, rgba(15, 74, 53, 0.9) 40%, rgba(10, 51, 36, 0.95) 100%),
        url('../img/bg_login.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    padding: 20px 16px;
    position: relative;
    overflow-y: auto;
}

.corner-tl {
    position: fixed;
    top: 16px;
    left: 16px;
    width: 28px;
    height: 28px;
    border-top: 2px solid rgba(212, 175, 55, 0.3);
    border-left: 2px solid rgba(212, 175, 55, 0.3);
}

.corner-tr {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 28px;
    height: 28px;
    border-top: 2px solid rgba(212, 175, 55, 0.3);
    border-right: 2px solid rgba(212, 175, 55, 0.3);
}

.corner-bl {
    position: fixed;
    bottom: 16px;
    left: 16px;
    width: 28px;
    height: 28px;
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
    border-left: 2px solid rgba(212, 175, 55, 0.3);
}

.corner-br {
    position: fixed;
    bottom: 16px;
    right: 16px;
    width: 28px;
    height: 28px;
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
    border-right: 2px solid rgba(212, 175, 55, 0.3);
}

.login-wrapper {
    width: 100%;
    max-width: 360px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Login Type Toggle */
.login-type-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 12px;
}

.login-type-btn {
    flex: 1;
    padding: 9px 6px;
    border: none;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.4);
    background: transparent;
}

.login-type-btn.active {
    background: linear-gradient(135deg, #d4af37 0%, #b8960c 100%);
    color: #0a2e22;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.25);
}

.login-type-btn:not(.active):hover {
    color: rgba(255, 255, 255, 0.7);
}

/* Dynamic fields */
.login-field {
    display: none;
}

.login-field.active {
    display: block;
}

/* Logo & Header */
.header-section {
    text-align: center;
    margin-bottom: 12px;
}

.logo-box {
    display: inline-block;
    margin-bottom: 6px;
}

.logo-box img {
    width: 45px;
    height: 45px;
    object-fit: contain;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.app-name {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}

.app-region {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
}

.app-region::before,
.app-region::after {
    content: '';
    width: 36px;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(212, 175, 55, 0.5));
}

.app-region::after {
    background: linear-gradient(to left, transparent, rgba(212, 175, 55, 0.5));
}

.app-region span {
    color: #d4af37;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Card */
.login-card {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 20px 22px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.card-heading {
    text-align: center;
    margin-bottom: 12px;
}

.card-heading h2 {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 3px;
}

.card-heading p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
}

/* Alert */
.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.alert-error i {
    color: #f87171;
    margin-top: 1px;
    font-size: 13px;
}

.alert-error p {
    color: #fca5a5;
    font-size: 12px;
    line-height: 1.4;
}

/* Form */
.form-group {
    margin-bottom: 10px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
}

.input-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(212, 175, 55, 0.6);
    font-size: 12px;
    z-index: 1;
    pointer-events: none;
}

.form-input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    color: #fff;
    transition: all 0.2s;
    outline: none;
}

.form-input:focus {
    border-color: rgba(212, 175, 55, 0.6);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.input-toggle-pw {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    padding: 4px;
    font-size: 13px;
    transition: color 0.2s;
}

.input-toggle-pw:hover {
    color: #d4af37;
}

.remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.remember-label {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    user-select: none;
}

.remember-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #d4af37;
}

.btn-submit {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #d4af37 0%, #b8960c 100%);
    color: #0a2e22;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.3);
}

.btn-submit:hover {
    background: linear-gradient(135deg, #f0d570 0%, #d4af37 100%);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.45);
    transform: translateY(-1px);
}

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

/* Footer */
.login-footer {
    text-align: center;
    margin-top: 16px;
}

.login-footer p {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 0.5px;
}

/* ========== RESPONSIVE ========== */
/* Tablet & small desktop */
@media (min-width: 768px) {
    body {
        padding: 32px 24px;
    }

    .login-wrapper {
        max-width: 360px;
    }
}

/* Mobile landscape & small screens */
@media (max-width: 480px) {
    body {
        padding: 16px 12px;
    }

    .login-wrapper {
        max-width: 100%;
    }

    .login-card {
        padding: 20px 16px;
        border-radius: 14px;
    }

    .header-section {
        margin-bottom: 16px;
    }

    .logo-box {
        margin-bottom: 8px;
    }

    .logo-box img {
        width: 50px;
        height: 50px;
        padding: 5px;
        border-radius: 12px;
    }

    .app-name {
        font-size: 19px;
    }

    .app-region span {
        font-size: 11px;
    }

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

    .card-heading h2 {
        font-size: 15px;
    }

    .card-heading p {
        font-size: 11px;
    }

    .form-input {
        padding: 10px 10px 10px 34px;
        font-size: 13px;
    }

    .btn-submit {
        padding: 11px;
        font-size: 13px;
    }

    .corner-tl,
    .corner-tr,
    .corner-bl,
    .corner-br {
        width: 20px;
        height: 20px;
    }
}

/* Very short screens (landscape phone) */
@media (max-height: 600px) {
    body {
        padding: 12px;
        align-items: flex-start;
    }

    .header-section {
        margin-bottom: 12px;
    }

    .logo-box {
        margin-bottom: 6px;
    }

    .logo-box img {
        width: 44px;
        height: 44px;
    }

    .app-name {
        font-size: 18px;
    }

    .login-card {
        padding: 18px 16px;
    }

    .form-group {
        margin-bottom: 10px;
    }

    .form-input {
        padding: 9px 10px 9px 34px;
    }

    .btn-submit {
        padding: 10px;
    }

    .remember-row {
        margin-bottom: 14px;
    }

    .login-footer {
        margin-top: 12px;
    }
}