/* ================================
   LOGIN CSS (Refactor-ready)
   ================================ */

/* Reset untuk halaman login */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

#globalLoading {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

#globalLoading.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ccc;
    border-top-color: #1a73e8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* Parent wrapper: halaman login dengan flex center */
.login-page {
    min-height: 100vh;
    background: #f4f7fb;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* ---------------- CARD ---------------- */
.login-card,
.card {
    background: #ffffff;
    width: 100%;
    max-width: 400px;
    padding: 40px 30px 30px;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    margin: auto;
}

/* ---------------- LOGO ---------------- */
.logo {
    text-align: center;
    margin-bottom: 25px;
}

.logo img {
    max-height: 60px;
}

/* ---------------- HEADINGS ---------------- */
h1 {
    text-align: center;
    font-size: 20px;
    margin: 0 0 20px 0;
    color: #1f2937;
}

.subtitle {
    text-align: center;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 25px;
}

/* ---------------- FORM ---------------- */
.form-group {
    margin-bottom: 15px;
    position: relative;
}

.form-group label {
    font-size: 13px;
    color: #374151;
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 11px 14px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ---------------- TOGGLE PASSWORD ---------------- */
.toggle-password {
    position: absolute;
    right: 14px;
    top: 34px;
    font-size: 12px;
    color: #2563eb;
    cursor: pointer;
    user-select: none;
    font-weight: 500;
}

.toggle-password:hover {
    color: #1d4ed8;
}

input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none;
}

/* ---------------- FORGOT PASSWORD LINK ---------------- */
.forgot-password {
    text-align: right;
    margin-top: 8px;
    margin-bottom: 8px;
}

.forgot-password a {
    font-size: 13px;
    color: #2563eb;
    text-decoration: none;
}

.forgot-password a:hover {
    text-decoration: underline;
}

#resetForm.disabled {
    opacity: 0.6;
    pointer-events: none; /* input & button tidak bisa diklik */
}

#resetForm.inactive,
#subtitle.inactive {
    display: none;
}

#resetError {
    margin-bottom: 20px;
}

/* ---------------- BUTTONS ---------------- */
.btn-login,
.btn-primary {
    width: 100%;
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    border: none;
    background: #2563eb;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-login:hover,
.btn-primary:hover {
    background: #1d4ed8;
}

/* ---------------- BACK LINK ---------------- */
.back-link {
    text-align: center;
    margin-top: 15px;
}

.back-link a {
    font-size: 13px;
    color: #2563eb;
    text-decoration: none;
}

.back-link a:hover {
    text-decoration: underline;
}

/* ---------------- FOOTER TEXT IN CARD ---------------- */
.footer-text {
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 25px;
}

/* ---------------- MESSAGES ---------------- */
.error-msg,
.error,
.success,
.info {
    font-size: 13px;
    text-align: center;
    margin-top: 12px;
    padding: 10px;
    border-radius: 6px;
    display: none;
    /* Hidden by default */
}

.error-msg,
.error {
    color: #dc2626;
    background: #fee2e2;
}

.success {
    color: #16a34a;
    background: #dcfce7;
}

.info {
    color: #2563eb;
    background: #dbeafe;
}

/* Show error when active */
.error-msg.active,
.error.active,
.success.active,
.info.active {
    display: block;
}