/* ===== MODERN COLOR SYSTEM ===== */
:root { --white: #ffffff; --primary-color: #2563eb; --text-primary: #1e293b; --text-secondary: #475569; --bg-light: #f8fafc;
    --text-tertiary: #64748b; --border-medium: #cbd5e1; --accent-red: #ef4444; --shadow-box: 0 0 0 3px #2575fc26;}
body {font-family: 'Poppins', sans-serif; background: var(--bg-light); display: flex; justify-content: center; align-items: center; min-height: 100vh; margin: 0;}
.main-container {display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 440px; background: var(--white); 
    border-radius: 12px; box-shadow: 0 0 10px #7e7e7e2d; overflow: hidden;}

/* === Header === */
.auth-header {padding: 40px 0 10px; width: 100%; text-align: center;}
.auth-header .logo img {width: 100px; height: 100px;}
.auth-header h1 {font-size: 28px; font-weight: 700; color: var(--text-primary);}

/* === Form === */
.auth-card {padding: 0 25px 15px; width: 100%; box-sizing: border-box;}
.auth-form {width: 100%;}
.input-group {position: relative; margin-top: 18px;}
.floating-group {position: relative;}
.floating-group input {width: 100%; padding: 15px 15px 15px 45px; border: 1px solid var(--border-medium); border-radius: 8px; background: var(--white);
    font-size: 15px; color: var(--text-primary); box-sizing: border-box; transition: border-color 0.3s ease, box-shadow 0.3s ease;}
.floating-group input:focus {outline: none; border-color: var(--primary-color); box-shadow: var(--shadow-box);}
.floating-group label {position: absolute; left: 45px; top: 15px; color: var(--text-tertiary); font-size: 15px; font-weight: 400; 
    pointer-events: none; transition: all 0.2s ease-out; background: transparent; padding: 0 5px;}
.floating-group input:focus + label, .floating-group input:not(:placeholder-shown) + label {top: -8px; 
    font-size: 12px; color: var(--primary-color); background: var(--white); padding: 0 5px;}

/* === Icons & toggles === */
.input-icon {position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); font-size: 18px;}
.password-toggle {position: absolute; right: 15px; top: 50%; transform: translateY(-50%); background: none; 
    border: none; color: var(--text-tertiary); font-size: 17.5px; cursor: pointer; padding: 5px;}
.password-toggle:hover {color: var(--text-primary);}

/* === Form options === */
.form-options {margin: 16px 0 0; text-align: right;}
.forgot-link {color: var(--primary-color); text-decoration: none; font-size: 14px; font-weight: 500;}
.forgot-link:hover {text-decoration: underline;}


/* === Custom checkbox === */
.policy-agreement {display: flex; flex-direction: column; align-items: start; margin: 22px 0 0; font-size: 14px; color: var(--text-secondary);}
.policy-agreement input[type="checkbox"] {position: absolute; opacity: 0; width: 0; height: 0;}
.policy-label {cursor: pointer; position: relative; padding-left: 22px;}
.policy-label .checkmark {position: absolute; left: 0; top: 0; height: 12px; width: 12px; border: 2px solid var(--border-medium); 
    border-radius: 10px; transition: all 0.3s ease;}
.checkmark:hover {border-color: var(--primary-color);}
.policy-agreement input:checked ~ .policy-label .checkmark {background-color: var(--primary-color); border-color: var(--primary-color);}
.policy-label .checkmark:after {content: ""; position: absolute; display: none; left: 3.5px; top: 1px; width: 2.6px; height: 7px; 
    border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg);}
.policy-agreement input:checked ~ .policy-label .checkmark:after {display: block;}
.policy-label a {color: var(--primary-color); text-decoration: none; font-weight: 500; margin: 0 3px;}
.policy-label a:hover {text-decoration: underline;}

/* === Submit Button === */
.auth-btn {width: 100%; padding: 15px; margin-top: 12px; background: linear-gradient(65deg, #2b69f0, var(--primary-color)); color: #fff; border: none; 
    border-radius: 10px; font-size: 18px; font-weight: 600; cursor: pointer; box-shadow: 0 4px 15px #00000033; transition: all 0.3s ease;}
.auth-btn:hover {transform: translateY(-1.25px); box-shadow: 0 6px 20px #00000040;}
.btn-loading {display: flex; align-items: center; justify-content: center; gap: 10px;}


/* === Redirect Button === */
.redirect-link {margin: 15px auto 12px; font-size: 14px; color: #666; text-align: center;}
.redirect-link a {color: #2575fc; text-decoration: none; font-weight: 500; transition: color 0.3s ease;}
.redirect-link a:hover {text-decoration: underline;}

/* === Error message === */
.error-message {color: var(--accent-red); font-size: 13px; margin: 10px 0 0; padding-left: 5px; display: none;}
.error-message.show {display: block; animation: slideDown 0.3s ease;}
.input-error {border-color: var(--accent-red) !important;}
.input-error:focus {box-shadow: 0 0 0 3px #dc354526 !important;}
.invalid {margin: 0; padding: 0;}
@keyframes slideDown {from {opacity: 0; transform: translateY(-5px);} to {opacity: 1; transform: translateY(0);}}

/* ==== Tablet responsiveness ==== */
@media (max-width: 700px) {
    .auth-header {padding: 35px 0 18px;}
    .auth-header h1 {font-size: 25px;}
    .auth-card {padding: 0 23px 10px 23px;}
    .floating-group input {font-size: 14px; padding: 14.35px 14.35px 14.35px 43px;}
    .floating-group label {left: 42px; font-size: 14px;}
    .input-icon, .password-toggle {font-size: 17px};
    .auth-btn {padding: 14px; font-size: 17px;}
    .policy-agreement, .redirect-link {font-size: 13.15px;}
}

@media (max-width: 520px) {
    body {background: var(--bg-light);}
    .main-container {box-shadow: none; border-radius: none; background: var(--bg-light); margin-bottom: 5px; min-height: 60vh;}
    .auth-header {padding: 1px 0 10px;}
    .auth-header .logo img {width: 80px; height: 80px; padding-bottom: 5px;}
    .auth-header h1 {font-size: 22px;}
    .floating-group input {font-size: 14px; padding: 14.1px 14.1px 14.1px 42px; background: var(--bg-light);}

    .password-toggle:hover { color: var(--text-tertiary); }
    .forgot-link:hover { text-decoration: none; }
    .policy-label a:hover { text-decoration: none; }
    .auth-btn:hover { transform: none; box-shadow: 0 4px 15px #00000033; }
    .redirect-link a:hover { text-decoration: none; }
}