/* ===========================================
   FUTURE TIMES GYM - LOGIN PAGE STYLES
   Premium, Responsive, Error-Free
   =========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --secondary: #00d4ff;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --light-gray: #e9ecef;
    --white: #ffffff;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    --radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --error: #ff4757;
    --success: #2ed573;
    --warning: #ffa502;
}

html {
    height: -webkit-fill-available;
}

body {
    background: linear-gradient(135deg, #001233 0%, #001f3f 100%);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Animated background particles */
.particles {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 15s infinite linear;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.container {
    width: 100%;
    max-width: 460px;
    position: relative;
    z-index: 2;
    margin: 20px auto;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: clamp(25px, 5vw, 50px) clamp(20px, 4vw, 45px);
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideUp 0.6s ease-out;
}

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

.logo {
    text-align: center;
    margin-bottom: clamp(25px, 6vw, 40px);
}

.logo h1 {
    font-size: clamp(24px, 6vw, 32px);
    font-weight: 800;
    background: linear-gradient(135deg, #ff5e00, #00d4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.logo p {
    color: var(--gray);
    font-size: clamp(14px, 4vw, 16px);
    font-weight: 500;
}

/* Form Styles */
.form-group {
    margin-bottom: clamp(20px, 5vw, 25px);
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--dark);
    font-size: clamp(14px, 4vw, 15px);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-label i {
    color: var(--primary);
    font-size: clamp(14px, 4vw, 16px);
}

.form-input {
    width: 100%;
    padding: clamp(14px, 4vw, 16px) clamp(16px, 4vw, 20px);
    border: 2px solid var(--light-gray);
    border-radius: 12px;
    font-size: clamp(14px, 4vw, 15px);
    transition: var(--transition);
    background: var(--white);
    color: var(--dark);
    font-weight: 500;
    min-height: 52px;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.15);
    transform: translateY(-2px);
}

.form-input.error {
    border-color: var(--error);
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.input-with-icon {
    position: relative;
}

.input-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
    font-size: clamp(14px, 4vw, 16px);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-icon:hover {
    color: var(--primary);
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: clamp(25px, 6vw, 30px);
    flex-wrap: wrap;
    gap: clamp(10px, 3vw, 15px);
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.remember-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid var(--primary);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.remember-checkbox.checked {
    background: var(--primary);
}

.remember-checkbox.checked i {
    color: white;
    font-size: 12px;
}

.remember-text {
    color: var(--dark);
    font-size: clamp(13px, 3.5vw, 14px);
    font-weight: 500;
}

.forgot-password {
    color: var(--primary);
    text-decoration: none;
    font-size: clamp(13px, 3.5vw, 14px);
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.forgot-password:hover {
    color: var(--primary-dark);
    transform: translateX(5px);
}

/* Buttons */
.btn {
    padding: clamp(16px, 4vw, 18px) clamp(20px, 5vw, 30px);
    border-radius: 12px;
    font-size: clamp(15px, 4vw, 16px);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    position: relative;
    overflow: hidden;
    min-height: 56px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #ff5e00, #00d4ff);
    color: white;
    box-shadow: 0 6px 20px rgba(255, 94, 0, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 94, 0, 0.4);
}

/* Messages */
.error-message {
    color: var(--error);
    font-size: clamp(12px, 3.5vw, 13px);
    margin-top: 8px;
    display: none;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.success-message {
    color: var(--success);
    font-size: clamp(14px, 4vw, 15px);
    text-align: center;
    margin-top: clamp(20px, 5vw, 25px);
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
    background: rgba(46, 213, 115, 0.1);
    padding: clamp(12px, 3vw, 15px);
    border-radius: 10px;
    border: 1px solid rgba(46, 213, 115, 0.2);
}

.info-message {
    color: var(--warning);
    font-size: clamp(13px, 3.5vw, 14px);
    text-align: center;
    margin-top: clamp(15px, 4vw, 20px);
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 165, 2, 0.1);
    padding: clamp(12px, 3vw, 15px);
    border-radius: 10px;
    border: 1px solid rgba(255, 165, 2, 0.2);
}

/* Forgot Password Form */
.forgot-form {
    display: none;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: clamp(25px, 6vw, 30px);
}

.back-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: clamp(20px, 5vw, 24px);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.back-btn:hover {
    background: rgba(67, 97, 238, 0.1);
    transform: translateX(-5px);
}

.form-header h2 {
    font-size: clamp(20px, 5vw, 24px);
    color: var(--dark);
    font-weight: 700;
}

/* IMPROVED LOADING OVERLAY - PERFECTLY CENTERED */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    max-width: 90%;
    text-align: center;
}

.spinner {
    width: min(60px, 15vw);
    height: min(60px, 15vw);
    border: 3px solid var(--light-gray);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 20px;
    color: var(--dark);
    font-weight: 600;
    font-size: clamp(14px, 4vw, 16px);
    text-align: center;
}

/* Notification System */
.notification {
    position: fixed;
    top: max(15px, env(safe-area-inset-top));
    right: max(15px, env(safe-area-inset-right));
    left: max(15px, env(safe-area-inset-left));
    padding: clamp(15px, 4vw, 20px);
    border-radius: 12px;
    color: white;
    font-weight: 600;
    display: none;
    align-items: center;
    gap: 15px;
    z-index: 10000;
    max-width: min(400px, 90%);
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.notification.success {
    background: linear-gradient(135deg, #2ed573, #1abc9c);
    border-left: 5px solid #1abc9c;
}

.notification.error {
    background: linear-gradient(135deg, #ff4757, #ff3838);
    border-left: 5px solid #ff3838;
}

.notification.info {
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-left: 5px solid #2980b9;
}

.notification i:first-child {
    font-size: clamp(20px, 5vw, 24px);
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: clamp(14px, 4vw, 16px);
    margin-bottom: 5px;
    font-weight: 700;
}

.notification-message {
    font-size: clamp(13px, 3.5vw, 14px);
    opacity: 0.9;
    font-weight: 500;
    word-wrap: break-word;
}

.notification-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: clamp(16px, 4vw, 18px);
    opacity: 0.8;
    transition: opacity 0.3s;
    flex-shrink: 0;
    padding: 5px;
}

.notification-close:hover {
    opacity: 1;
}

/* Registration Link */
.register-link {
    text-align: center;
    margin-top: clamp(25px, 6vw, 30px);
    color: var(--gray);
    font-size: clamp(14px, 4vw, 15px);
}

.register-link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    margin-left: 5px;
    transition: var(--transition);
}

.register-link a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* WhatsApp Floating Button */
.whatsapp-float {
    position: fixed;
    width: clamp(50px, 12vw, 60px);
    height: clamp(50px, 12vw, 60px);
    bottom: clamp(15px, 4vw, 30px);
    right: clamp(15px, 4vw, 30px);
    background-color: #25D366;
    color: white;
    border-radius: 50px;
    text-align: center;
    font-size: clamp(24px, 6vw, 30px);
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    text-decoration: none;
    animation: pulse 2s infinite;
}

.whatsapp-float:hover {
    background-color: #128C7E;
    transform: scale(1.1);
}

.whatsapp-tooltip {
    position: absolute;
    background-color: #333;
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: clamp(12px, 3vw, 14px);
    right: calc(clamp(50px, 12vw, 60px) + 15px);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.whatsapp-float:hover .whatsapp-tooltip {
    opacity: 1;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* Responsive Breakpoints */
@media (max-width: 360px) {
    body { padding: 10px; }
    .login-card { padding: 20px 15px; }
    .logo h1 { font-size: 22px; }
    .whatsapp-tooltip { display: none; }
}

@media (max-width: 480px) {
    .notification {
        top: 10px;
        left: 10px;
        right: 10px;
        max-width: none;
    }
}

@media (max-height: 600px) and (orientation: landscape) {
    body {
        align-items: flex-start;
        padding: 15px;
    }
    .container { margin: 10px auto; }
    .login-card { padding: 20px; }
    .logo { margin-bottom: 20px; }
    .form-group { margin-bottom: 15px; }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .btn, .input-icon, .back-btn, .remember-me, .forgot-password {
        min-height: 44px;
    }
    .form-input { min-height: 48px; }
    .whatsapp-float:hover { transform: none; }
    .btn:hover { transform: none; }
}

/* Improve scrolling on mobile */
.login-card {
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
    max-height: 90vh;
}

/* Small hint text for phone */
small {
    color: var(--gray);
    font-size: 12px;
    margin-top: 4px;
    display: block;
}