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

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Microsoft YaHei', sans-serif;
    font-size: 15px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #162d4a 100%);
    position: relative;
    overflow: hidden;
}

/* Decorative background circles */
html::before {
    content: '';
    position: fixed;
    top: -180px;
    right: -120px;
    width: 560px;
    height: 560px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(220, 38, 38, 0.08) 0%, transparent 70%);
    pointer-events: none;
}
html::after {
    content: '';
    position: fixed;
    bottom: -200px;
    left: -100px;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.container {
    width: 100%;
    max-width: 440px;
    padding: 24px;
    position: relative;
    z-index: 1;
}

.card {
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 10px 30px -5px rgba(0, 0, 0, 0.15),
        0 20px 60px -10px rgba(0, 0, 0, 0.2);
    padding: 44px 40px 40px;
    animation: cardIn 0.5s ease-out;
}

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

/* ---- Brand / Header ---- */
.card-brand {
    text-align: center;
    margin-bottom: 36px;
}
.brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    margin-bottom: 16px;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3);
}
.brand-icon svg {
    width: 28px;
    height: 28px;
}
.brand-title {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.3px;
}
.brand-subtitle {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 4px;
    font-weight: 400;
}

.card-header { text-align: center; margin-bottom: 0; }
.card-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

/* ---- Language Bar ---- */
.lang-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 28px;
}

select::-ms-expand { display: none; }
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    height: 34px;
    padding: 0 30px 0 12px;
    font-size: 13px;
    color: #475569;
    background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
select:hover { border-color: #cbd5e1; }
select:focus { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1); }

.language {
    background: url(../Images/flags.jpg) 0px 0px;
    display: block;
    width: 24px;
    height: 19px;
    border: 1px solid rgba(150, 150, 150, 0.49);
    border-radius: 3px;
    box-shadow: inset 0px 2px 0px #d9d9d9;
    flex-shrink: 0;
}

/* ---- Error Message ---- */
.msg-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 24px;
    color: #dc2626;
    font-size: 13px;
    display: none;
    line-height: 1.5;
}

/* ---- Form ---- */
.form-group {
    margin-bottom: 18px;
    position: relative;
}

.form-control {
    width: 100%;
    height: 50px;
    padding: 0 44px 0 44px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    color: #1e293b;
    background-color: #f8fafc;
    transition: all 0.25s ease;
    outline: none;
}
.form-control:hover {
    border-color: #cbd5e1;
    background-color: #ffffff;
}
.form-control:focus {
    border-color: #dc2626;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.08);
}
.form-control::placeholder {
    color: #94a3b8;
    font-size: 14px;
}

/* ---- Icons ---- */
.form-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.2s ease;
}

.icon-user,
.icon-lock {
    display: block;
    width: 18px;
    height: 18px;
}

/* User icon */
.icon-user::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 2px;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #94a3b8;
}
.icon-user::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 11px;
    transform: translateX(-50%);
    width: 14px;
    height: 6px;
    border-radius: 6px 6px 0 0;
    background-color: #94a3b8;
}

/* Lock icon */
.icon-lock::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 1px;
    transform: translateX(-50%);
    width: 8px;
    height: 6px;
    border: 1.5px solid #94a3b8;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
}
.icon-lock::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 6px;
    transform: translateX(-50%);
    width: 12px;
    height: 9px;
    background-color: #94a3b8;
    border-radius: 1px;
}

/* Icon color change on input focus */
.form-group:focus-within .icon-user::before,
.form-group:focus-within .icon-user::after {
    background-color: #dc2626;
}
.form-group:focus-within .icon-lock::before {
    border-color: #dc2626;
}
.form-group:focus-within .icon-lock::after {
    background-color: #dc2626;
}

/* ---- Options Row ---- */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    margin-top: 4px;
}

.form-options label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
    color: #64748b;
    gap: 7px;
    user-select: none;
}

.form-options label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #dc2626;
    border-radius: 4px;
}

.form-options .forgot-link {
    color: #dc2626;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s ease;
}
.form-options .forgot-link:hover {
    color: #b91c1c;
    text-decoration: underline;
}

/* ---- Login Button ---- */
.btn {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    outline: none;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #ffffff;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3);
    position: relative;
    overflow: hidden;
}
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
    pointer-events: none;
}
.btn:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
    transform: translateY(-1px);
}
.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.btn:disabled,
.buttondisable {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
    transform: none;
    box-shadow: none;
}

.hidden-checkbox { display: none; }

/* ---- Password Toggle (Eye Icon) ---- */
.toggle-pwd {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    cursor: pointer;
    z-index: 2;
    opacity: 0.4;
    transition: opacity 0.2s ease;
}
.toggle-pwd:hover { opacity: 0.75; }
.toggle-pwd.show { opacity: 0.75; }

/* Closed eye */
.toggle-pwd::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 14px;
    border: 2px solid #64748b;
    border-radius: 50%;
    transition: all 0.2s ease;
}
.toggle-pwd::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 2px;
    height: 18px;
    background: #64748b;
    border-radius: 1px;
    transition: all 0.2s ease;
}

/* Open eye - when showing password */
.toggle-pwd.show::before {
    border-color: #dc2626;
}
.toggle-pwd.show::after {
    width: 0;
    height: 0;
}
.toggle-pwd.show {
    background:
        radial-gradient(circle, #dc2626 2.5px, transparent 2.5px);
    background-position: center;
    background-repeat: no-repeat;
}

.form-group:focus-within .toggle-pwd::before { border-color: #94a3b8; }
.form-group:focus-within .toggle-pwd::after { background: #94a3b8; }
.form-group:focus-within .toggle-pwd.show::before { border-color: #dc2626; }
.form-group:focus-within .toggle-pwd.show { background: radial-gradient(circle, #dc2626 2.5px, transparent 2.5px) no-repeat center; }

#divLoading { display: none; }

/* ---- Responsive ---- */
@media only screen and (max-device-width: 767px) {
    html, body {
        align-items: flex-start;
        padding-top: 30px;
    }
    html::before, html::after { display: none; }
    .card {
        border-radius: 12px;
        padding: 32px 24px 28px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    }
    .brand-icon { width: 48px; height: 48px; border-radius: 12px; }
    .brand-icon svg { width: 24px; height: 24px; }
}

@media (min-width: 768px) {
    /* Subtle hover lift for the whole card on desktop */
    .card {
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    .card:hover {
        transform: translateY(-2px);
        box-shadow:
            0 6px 10px rgba(0, 0, 0, 0.1),
            0 14px 36px rgba(0, 0, 0, 0.18),
            0 24px 70px rgba(0, 0, 0, 0.22);
    }
}
