/* ===== VARIABLES ===== */
:root {
    --primary-color: #4e73df;
    --secondary-color: #1cc88a;
    --dark-color: #5a5c69;
    --light-color: #f8f9fc;
    --danger-color: #e74a3b;
    --success-color: #1cc88a;
}

/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

/* ===== BODY & BACKGROUND ===== */
body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* ===== BUBBLE EFFECT ===== */
.bubble {
    position: fixed;
    border-radius: 50%;
    background: radial-gradient(circle at center, rgba(255,255,255,0.3) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
    box-shadow: 0 0 50px rgba(255,255,255,0.2);
    transition: transform 0.1s ease-out;
    will-change: transform;
}

.bubble:nth-child(1) {
    width: 400px;
    height: 400px;
    top: -150px;
    left: -150px;
    animation: bubbleFloat1 20s infinite;
}

.bubble:nth-child(2) {
    width: 300px;
    height: 300px;
    bottom: -100px;
    right: -100px;
    animation: bubbleFloat2 25s infinite;
}

.bubble:nth-child(3) {
    width: 350px;
    height: 350px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: bubbleFloat3 30s infinite;
}

@keyframes bubbleFloat1 {
    0% { transform: translate(0, 0) scale(1); opacity: 0.4; }
    33% { transform: translate(100px, 50px) scale(1.2); opacity: 0.6; }
    66% { transform: translate(-50px, 30px) scale(0.9); opacity: 0.4; }
    100% { transform: translate(0, 0) scale(1); opacity: 0.4; }
}

@keyframes bubbleFloat2 {
    0% { transform: translate(0, 0) scale(1); opacity: 0.4; }
    33% { transform: translate(-80px, -50px) scale(1.2); opacity: 0.6; }
    66% { transform: translate(50px, -30px) scale(0.9); opacity: 0.4; }
    100% { transform: translate(0, 0) scale(1); opacity: 0.4; }
}

@keyframes bubbleFloat3 {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.4; }
    33% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.6; }
    66% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.4; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0.4; }
}

/* ===== FORM CONTAINER ===== */
.form-container {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 50px;
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.1),
        inset 0 0 20px rgba(255, 255, 255, 0.5);
    width: min(96%, 650px);
    padding: clamp(25px, 5vw, 40px);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    margin: 0 auto;
    transform: translateY(0);
    transition: all 0.3s ease;
    z-index: 1;
}

/* ลบ Bubble Effect เดิมที่ container */
.form-container::before {
    display: none;
}

/* ===== FORM HEADER ===== */
.form-header {
    text-align: center;
    margin-bottom: clamp(20px, 5vw, 40px);
    position: relative;
}

.form-header h1 {
    color: var(--dark-color);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 600;
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
}

.form-header h1::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px;
}

.form-header p {
    color: var(--dark-color);
    opacity: 0.8;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

/* ===== NAVIGATION TABS ===== */
.nav-tabs {
    border: none;
    margin-bottom: clamp(20px, 4vw, 30px);
    justify-content: center;
    gap: 10px;
}

.nav-tabs .nav-link {
    border: none;
    padding: clamp(10px, 3vw, 15px) clamp(20px, 4vw, 30px);
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: 500;
    color: var(--dark-color);
    opacity: 0.7;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.nav-tabs .nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-tabs .nav-link:hover::before {
    width: 100%;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    opacity: 1;
    background: none;
}

.nav-tabs .nav-link.active::before {
    width: 100%;
}

/* ===== FORM GROUPS & INPUTS ===== */
.form-group {
    margin-bottom: clamp(15px, 3vw, 25px);
    position: relative;
}

.form-control {
    height: 50px;
    border-radius: 25px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    padding-left: 45px;
    padding-right: 45px;
    font-size: clamp(0.9rem, 2vw, 1rem);
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
    width: 100%;
    box-shadow: 
        0 5px 15px rgba(0, 0, 0, 0.05),
        inset 0 0 10px rgba(255, 255, 255, 0.5);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 
        0 0 15px rgba(78, 115, 223, 0.3),
        inset 0 0 10px rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
}

/* ===== FORM ICONS ===== */
.form-group i.input-icon {
    position: absolute;
    left: 15px;
    top: 16px;
    color: var(--dark-color);
    opacity: 0.7;
    transition: all 0.3s ease;
    z-index: 1;
    pointer-events: none;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

/* ===== PASSWORD TOGGLE ===== */
.form-group .password-toggle {
    position: absolute;
    right: 15px;
    top: 16px;
    cursor: pointer;
    color: var(--dark-color);
    opacity: 0.7;
    transition: all 0.3s ease;
    z-index: 2;
    background: none;
    border: none;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.password-toggle:hover {
    opacity: 1;
}

/* ===== FORM VALIDATION ===== */
.invalid-feedback {
    display: none;
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 5px;
    animation: shake 0.5s ease;
}

.is-invalid {
    border-color: var(--danger-color) !important;
    animation: shake 0.5s ease;
}

.is-invalid ~ .invalid-feedback {
    display: block;
}

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

/* ===== BUTTONS ===== */
.btn {
    height: 50px;
    border-radius: 25px;
    font-weight: 600;
    padding: 0 30px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
    font-size: clamp(0.9rem, 2vw, 1rem);
    background: linear-gradient(135deg, var(--primary-color) 0%, #3a5ac4 100%);
    border: none;
    box-shadow: 
        0 5px 15px rgba(0, 0, 0, 0.1),
        inset 0 0 10px rgba(255, 255, 255, 0.5);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.15),
        inset 0 0 15px rgba(255, 255, 255, 0.8);
}

.btn:active {
    transform: translateY(0);
}

/* ===== SOCIAL LOGIN ===== */
.social-login {
    margin-top: clamp(20px, 4vw, 30px);
    text-align: center;
}

.social-login p {
    color: var(--dark-color);
    margin-bottom: 20px;
    position: relative;
}

.social-login p::before,
.social-login p::after {
    content: "";
    position: absolute;
    height: 1px;
    width: 30%;
    background: #e9ecef;
    top: 50%;
}

.social-login p::before {
    left: 0;
}

.social-login p::after {
    right: 0;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: clamp(10px, 2vw, 15px);
    margin-top: 15px;
}

.social-icons a {
    width: clamp(40px, 8vw, 50px);
    height: clamp(40px, 8vw, 50px);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark-color);
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    transition: all 0.3s ease;
    box-shadow: 
        0 5px 15px rgba(0, 0, 0, 0.1),
        inset 0 0 10px rgba(255, 255, 255, 0.5);
}

.social-icons a:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.15),
        inset 0 0 15px rgba(255, 255, 255, 0.8);
}

/* ===== LOADING SPINNER ===== */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    display: none;
    backdrop-filter: blur(5px);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--primary-color);
    border-top: 5px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== TAB CONTENT ANIMATION ===== */
.tab-pane {
    animation: fadeIn 0.5s ease;
}

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

/* ===== PASSWORD STRENGTH METER ===== */
.password-strength {
    height: 5px;
    margin-top: 5px;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.strength-0 { width: 0%; background: var(--danger-color); }
.strength-1 { width: 25%; background: var(--danger-color); }
.strength-2 { width: 50%; background: #ffc107; }
.strength-3 { width: 75%; background: #17a2b8; }
.strength-4 { width: 100%; background: var(--success-color); }

/* ===== THEME TOGGLE ===== */
.theme-toggle {
    position: fixed;
    top: 25px;
    right: 25px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.25);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle i {
    font-size: 1.3rem;
    color: var(--dark-color);
    transition: all 0.3s ease;
}

/* ===== DARK THEME ===== */
[data-theme="dark"] {
    --primary-color: #4e73df;
    --secondary-color: #1cc88a;
    --dark-color: #f8f9fc;
    --light-color: #2d3748;
    --danger-color: #e74a3b;
    --success-color: #1cc88a;
    --bg-color: #1a202c;
    --form-bg: rgba(45, 55, 72, 0.95);
}

[data-theme="dark"] body {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
}

[data-theme="dark"] .form-container {
    background: var(--form-bg);
    color: var(--dark-color);
}

[data-theme="dark"] .form-control {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--dark-color);
}

[data-theme="dark"] .form-control:focus {
    background: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .social-icons a {
    background: rgba(255, 255, 255, 0.1);
    color: var(--dark-color);
}

[data-theme="dark"] .theme-toggle {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .theme-toggle i {
    color: var(--light-color);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .form-container {
        width: 94%;
        padding: clamp(20px, 4vw, 30px);
    }

    .theme-toggle {
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }

    .theme-toggle i {
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .form-container {
        width: 92%;
        padding: 20px;
    }

    .nav-tabs .nav-link {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    .form-control {
        height: 45px;
        padding-left: 40px;
        padding-right: 40px;
    }

    .form-group i.input-icon,
    .form-group .password-toggle {
        top: 14px;
    }

    .btn {
        height: 45px;
    }

    .theme-toggle {
        top: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
    }

    .theme-toggle i {
        font-size: 1.1rem;
    }
}

@media (max-width: 380px) {
    .form-container {
        padding: 15px;
    }

    .form-header h1 {
        font-size: 1.5rem;
    }

    .nav-tabs .nav-link {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
} 