/* ========================================
   AUTH PAGES - SHARED STYLES
   Login & Register Pages
   ======================================== */

:root {
    --primary-green: #0fae64;
    --accent-blue: #00692f;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #F5F6F5, #e0e7ea);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 20px;
}

/* REGISTER PAGE - Different body padding */
body.bg-custom {
    padding: 1rem;
}

.bg-custom {
    background-image: url('/images/beggar_banner.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* FIX: Make background cover full viewport for register page */
body.bg-custom::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/images/beggar_banner.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
}

/* LOGIN PAGE - Fixed background */
body:not(.bg-custom) .bg-custom {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* ========================================
   CARD/TILE STYLES
   ======================================== */

.stat-tile {
    position: relative;
    background: linear-gradient(135deg, var(--primary-green), var(--accent-blue));
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding: 1.5rem;
    transform: translateY(0);
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 2px solid transparent;
    animation: slideInUp 0.6s ease forwards;
    width: 100%;
    max-width: 32rem;
    margin: 0 auto;
}

/* Register page has different max-width and padding */
body.bg-custom .stat-tile {
    max-width: 48rem;
    padding: 2rem;
}

.stat-tile:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.tile-glow {
    position: absolute;
    inset: 0;
    border-radius: 1rem;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
}

.stat-tile:hover .tile-glow {
    opacity: 1;
}

.texture-overlay {
    position: absolute;
    inset: 0;
    background: url('https://www.transparenttextures.com/patterns/wavecut.png');
    opacity: 0.1;
    background-repeat: repeat;
    border-radius: 1rem;
    pointer-events: none;
}

.form-content {
    position: relative;
    z-index: 10;
}

/* ========================================
   FORM TITLE
   ======================================== */

.form-title,
.title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1.25rem;
    letter-spacing: -0.025em;
}

.title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

/* ========================================
   FORM LAYOUT
   ======================================== */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

/* For register form grid */
.form-grid .form-group {
    margin-bottom: 0;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

/* ========================================
   FORM INPUTS
   ======================================== */

.form-label,
.input-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
    opacity: 0.9;
    margin-bottom: 0.4rem;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.form-input {
    width: 100%;
    background: white;
    color: black;
    border-radius: 0.5rem;
    padding: 0.6rem;
    outline: none;
    border: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Register page has slightly different input styling */
body.bg-custom .form-input {
    border: 1px solid #d1d5db;
    color: #333;
}

.form-input::placeholder {
    color: #9ca3af;
}

.form-input:focus {
    ring: 2px;
    ring-color: #2a7b9b;
    border-color: transparent;
    box-shadow: 0 0 0 2px #2a7b9b;
}

body.bg-custom .form-input:focus {
    box-shadow: 0 0 0 2px rgba(15, 174, 100, 0.5);
    border-color: #0fae64;
}

.form-input.error {
    border-color: #f56565;
}

body.bg-custom .form-input.error {
    border-color: #f56565;
}

.error-message,
.error-text {
    color: #f56565;
    font-size: 0.7rem;
    margin-top: 0.2rem;
    display: block;
}
.form-label,
.input-label,
label[for="email"],
label {
    transform: none !important;
    scale: none !important; /* or scale: 1 !important; */
    opacity: 0.9 !important;
    position: static !important; /* if it's being positioned absolutely */
}

/* ========================================
   PASSWORD FIELD WITH TOGGLE
   ======================================== */

.password-wrapper,
.password-container {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    opacity: 0.7;
    cursor: pointer;
    transition: opacity 0.3s;
    padding: 0.2rem;
}

body.bg-custom .toggle-password {
    color: #6b7280;
}

.toggle-password:hover {
    opacity: 1;
}

body.bg-custom .toggle-password:hover {
    color: #374151;
}

.toggle-password i.fa-eye-slash {
    display: none;
}

.toggle-password.show-password i.fa-eye {
    display: none;
}

.toggle-password.show-password i.fa-eye-slash {
    display: inline;
}

/* ========================================
   CAPTCHA SECTION
   ======================================== */

.captcha-container {
    margin-top: 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.captcha-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    position: relative;
}

.captcha-container img {
    border: 1px solid #ccc;
    border-radius: 0.5rem;
    max-width: 220px;
    height: auto;
}

body.bg-custom .captcha-container img {
    max-width: 180px;
}

.captcha-refresh-btn,
.captcha-container button {
    padding: 0.4rem 0.8rem;
    background: #0f743d;
    color: white;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 0.9rem;
    position: absolute;
    right: -40px;
    top: 50%;
    transform: translateY(-50%);
}

.captcha-refresh-btn:hover,
.captcha-container button:hover {
    background: #00692f;
}

.captcha-input {
    width: 100%;
    max-width: 220px;
    padding: 0.4rem;
    border: 1px solid #ccc;
    border-radius: 0.25rem;
    font-size: 0.9rem;
    text-align: center;
}

body.bg-custom .captcha-input {
    max-width: 180px;
    background: white;
    color: #333;
}

.captcha-input.error {
    border-color: #dc3545;
}

.captcha-error {
    color: #dc3545;
    font-size: 0.75rem;
    margin-top: 0.2rem;
}

.audio-btn {
    background: #0f743d;
    color: white;
    border: none;
    border-radius: 0.25rem;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 0.9rem;
}

body.bg-custom .audio-btn {
    margin-top: 0.75rem;
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
}

.audio-btn:hover {
    background: #00692f;
}

/* ========================================
   REMEMBER ME & FORGOT PASSWORD
   ======================================== */

.remember-forgot-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    margin-top: 1rem;
}

.remember-me-wrapper,
.remember-container {
    display: flex;
    align-items: center;
}

.remember-container {
    margin-bottom: 1rem;
    margin-top: 1rem;
}

.remember-checkbox {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    margin-right: 0.4rem;
}

body.bg-custom .remember-checkbox {
    background: white;
    border: 1px solid #d1d5db;
}

.remember-checkbox:checked {
    background-color: #2a7b9b;
    border-color: #2a7b9b;
}

.remember-label {
    font-size: 0.8rem;
    color: white;
    opacity: 0.9;
    cursor: pointer;
}

.forgot-password-link {
    font-size: 0.8rem;
    color: white;
    opacity: 0.9;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.forgot-password-link:hover {
    color: #2a7b9b;
    opacity: 1;
}

/* ========================================
   SUBMIT BUTTON
   ======================================== */

.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #0fae64, #00692f, #0d3d2a);
    color: white;
    font-weight: 600;
    border-radius: 0.5rem;
    padding: 0.6rem 0.8rem;
    transition: all 0.3s ease-in-out;
    transform: scale(1);
    outline: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #0d3d2a, #00692f, #0fae64);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}

body.bg-custom .submit-btn:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transform: scale(1.02);
}

.submit-btn:focus {
    ring: 2px;
    ring-color: #0fae64;
    ring-opacity: 0.5;
    box-shadow: 0 0 0 2px rgba(15, 174, 100, 0.5);
}

/* ========================================
   REGISTER/LOGIN LINKS
   ======================================== */

.register-section,
.login-link {
    text-align: center;
    margin-top: 1rem;
}

.register-text,
.login-link p {
    font-size: 0.8rem;
    color: white;
    opacity: 0.9;
    margin-bottom: 0.4rem;
}

.register-link,
.login-link a {
    font-size: 0.8rem;
    color: white;
    opacity: 0.9;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.register-link:hover,
.login-link a:hover {
    color: #0fae64;
    opacity: 1;
}

body.bg-custom .login-link a:hover {
    color: #0fae64;
}

/* ========================================
   ALERT MESSAGES
   ======================================== */

.alert-message,
.alert {
    max-width: 28rem;
    margin: 1rem auto;
    text-align: center;
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    animation: slideInUp 0.6s ease forwards;
    position: relative;
    margin-bottom: 1.5rem;
}

body.bg-custom .alert {
    max-width: 46rem;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    border: 1px solid #1a5f7a;
}

.alert-error {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    border: 1px solid #1a5f7a;
}

.alert-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #0A3D62;
    opacity: 0.7;
    cursor: pointer;
    transition: opacity 0.3s;
    padding: 0;
    line-height: 1;
    width: 20px;
    height: 20px;
}

.alert-close:hover {
    opacity: 1;
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   RESPONSIVE STYLES
   ======================================== */

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    body.bg-custom .stat-tile {
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    body {
        padding: 1rem;
    }
    
    .stat-tile {
        padding: 1rem;
    }
    
    .form-title {
        font-size: 1.25rem;
    }
    
    .captcha-container img {
        max-width: 180px;
    }
    
    body.bg-custom .captcha-container img {
        max-width: 140px;
    }
    
    .captcha-refresh-btn,
    .captcha-container button {
        right: -30px;
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .captcha-input {
        max-width: 180px;
    }
    
    body.bg-custom .captcha-input {
        max-width: 160px;
    }
    
    .remember-forgot-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}