/* Login & Register Page - Complete Standalone Styles */
@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&display=swap');

/* ========================================
   RESET & BASE
======================================== */

/* Update all font-family */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Prompt', sans-serif;
    overflow-x: hidden;
}

.login-page-container,
.login-input,
.login-label,
.login-submit-button,
.login-btn-text,
.login-resend-button,
.login-resend-timer,
.login-action-link {
    font-family: 'Prompt', sans-serif !important;
}

/* ========================================
   CONTAINER
======================================== */
.login-page-container {
    width: 100%;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* ========================================
   HERO SECTION
======================================== */
.login-hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    overflow: hidden;
}

/* Hero Background */
.login-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1C1C1E 0%, #2C2C2E 50%, #3C3C3E 100%);
    z-index: 1;
}

.login-hero-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(254, 214, 56, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(231, 36, 59, 0.1) 0%, transparent 50%);
    animation: bgPulse 8s ease-in-out infinite;
}

@keyframes bgPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ========================================
   FLOATING IMAGES
======================================== */
.login-floating-images {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 2;
    pointer-events: none;
}

.login-float-img {
    position: absolute;
    width: 80px;
    height: 80px;
    object-fit: contain;
    opacity: 0.3;
    filter: brightness(1.2);
}

.login-float-1 {
    top: 10%;
    left: 10%;
    animation: floatAnimation1 15s ease-in-out infinite;
}

.login-float-2 {
    top: 20%;
    right: 15%;
    animation: floatAnimation2 18s ease-in-out infinite;
}

.login-float-3 {
    bottom: 20%;
    left: 15%;
    animation: floatAnimation3 20s ease-in-out infinite;
}

.login-float-4 {
    bottom: 15%;
    right: 20%;
    animation: floatAnimation1 16s ease-in-out infinite;
}

.login-float-5 {
    top: 50%;
    left: 5%;
    animation: floatAnimation2 14s ease-in-out infinite;
}

.login-float-6 {
    top: 60%;
    right: 10%;
    animation: floatAnimation3 19s ease-in-out infinite;
}

@keyframes floatAnimation1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(20px, -20px) rotate(5deg); }
    50% { transform: translate(-10px, 20px) rotate(-5deg); }
    75% { transform: translate(15px, 10px) rotate(3deg); }
}

@keyframes floatAnimation2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(-15px, 15px) rotate(-3deg); }
    66% { transform: translate(15px, -10px) rotate(3deg); }
}

@keyframes floatAnimation3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(10px, -15px) scale(1.1); }
}

/* ========================================
   FLOATING ELEMENTS
======================================== */
.login-floating-elements {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 2;
    pointer-events: none;
}

.login-float-circle,
.login-float-triangle,
.login-float-square {
    position: absolute;
    opacity: 0.1;
}

.login-float-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px solid #FED638;
}

.login-float-circle-1 {
    top: 15%;
    right: 25%;
    animation: float 20s ease-in-out infinite;
}

.login-float-circle-2 {
    bottom: 25%;
    left: 20%;
    animation: float 25s ease-in-out infinite reverse;
}

.login-float-circle-3 {
    top: 50%;
    right: 10%;
    width: 60px;
    height: 60px;
    animation: float 18s ease-in-out infinite;
}

.login-float-triangle {
    top: 30%;
    left: 30%;
    width: 0;
    height: 0;
    border-left: 50px solid transparent;
    border-right: 50px solid transparent;
    border-bottom: 86px solid rgba(231, 36, 59, 0.3);
    animation: rotate 30s linear infinite;
}

.login-float-square {
    bottom: 20%;
    right: 30%;
    width: 80px;
    height: 80px;
    border: 2px solid rgba(64, 138, 238, 0.3);
    animation: float 22s ease-in-out infinite;
}

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

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

/* ========================================
   HERO CONTENT
======================================== */
.login-hero-content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.login-content-wrapper {
    text-align: center;
    animation: fadeInUp 1s ease-out;
}

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

/* ========================================
   TITLE & SUBTITLE
======================================== */
.login-main-title {
    font-size: 3.5rem;
    font-weight: 700;
    font-family: 'prompt';
    color: #ffffff;
    margin-bottom: 20px;
    line-height: 1.2;
}

.login-highlight {
    background: linear-gradient(135deg, #FED638 0%, #ffffff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'prompt';
    background-clip: text;
    display: inline-block;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

.login-subtitle {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 50px;
    line-height: 1.6;
    font-weight: 400;
}

.login-subtitle strong {
    color: #FED638;
    font-weight: 600;
}

/* ========================================
   FORM CONTAINER
======================================== */
.login-form-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 40px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.login-form-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* ========================================
   FORM
======================================== */
.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.login-form-group {
    position: relative;
    margin-bottom: 30px;
}

/* ========================================
   INPUT FIELDS
======================================== */
.login-input-container {
    position: relative;
    width: 100%;
}

.login-input {
    width: 100%;
    padding: 15px 0;
    font-size: 1.2rem;
    font-weight: 500;
    color: #ffffff !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3) !important;
    outline: none !important;
    font-family: 'Kanit', sans-serif;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    box-shadow: none !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Remove autofill background */
.login-input:-webkit-autofill,
.login-input:-webkit-autofill:hover,
.login-input:-webkit-autofill:focus,
.login-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px transparent inset !important;
    -webkit-text-fill-color: #ffffff !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Remove default validation styles */
.login-input:invalid {
    box-shadow: none !important;
    outline: none !important;
}

.login-input:valid {
    box-shadow: none !important;
    outline: none !important;
}

.login-input:required {
    box-shadow: none !important;
}

.login-input::placeholder {
    color: transparent;
}

.login-input:focus {
    border-bottom-color: #FED638 !important;
}

/* ========================================
   LABEL
======================================== */
.login-label {
    position: absolute;
    left: 0;
    top: 15px;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    pointer-events: none;
    transition: all 0.3s ease;
    font-family: 'Kanit', sans-serif;
    z-index: 1;
}

.login-input:focus + .login-label,
.login-input:not(:placeholder-shown) + .login-label {
    transform: translateY(-25px) scale(0.85);
    color: #FED638;
    font-weight: 600;
}

/* ========================================
   UNDERLINE ANIMATION
======================================== */
.login-underline {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #FED638, #ffffff);
    transition: width 0.4s ease;
    z-index: 2;
}

.login-input:focus ~ .login-underline {
    width: 100%;
}

/* ========================================
   INPUT STATES
======================================== */
.login-input.error {
    border-bottom-color: #ff6b6b !important;
    animation: shake 0.5s ease-in-out;
}

.login-input.error + .login-label {
    color: #ff6b6b !important;
}

.login-input.success {
    border-bottom-color: #4ade80 !important;
}

.login-input.success + .login-label {
    color: #4ade80 !important;
}

.login-input.success ~ .login-underline {
    background: linear-gradient(90deg, #4ade80, #22c55e);
    width: 100%;
}

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

/* ========================================
   FORM MESSAGES
======================================== */
.login-form-message {
    position: absolute;
    bottom: -25px;
    left: 0;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.login-form-message.error {
    color: #ff6b6b;
}

.login-form-message.success {
    color: #4ade80;
}

.login-form-message.show {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   BUTTONS
======================================== */
.login-submit-button {
    position: relative;
    background: #E7243B;
    color: #ffffff;
    border: 2px solid #ffffff;
    border-radius: 8px;
    padding: 16px 80px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 5px 5px 0px 0px #FED638;
    font-family: 'Kanit', sans-serif;
    margin: 10px auto 0;
    min-width: 200px;
    overflow: hidden;
}

.login-submit-button:hover {
    background: #408aee;
    transform: translateY(-2px);
    box-shadow: 7px 7px 0px 0px #FED638;
}

.login-submit-button:active {
    transform: translateY(0px);
    box-shadow: 3px 3px 0px 0px #FED638;
}

.login-submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.login-submit-button.loading {
    pointer-events: none;
    opacity: 0.8;
}

.login-submit-button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 30px;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.login-btn-text {
    position: relative;
    z-index: 2;
}

/* Secondary Button */
.login-secondary-btn {
    background: transparent !important;
    border: 2px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 3px 3px 0px 0px rgba(255, 255, 255, 0.2) !important;
    margin-top: 15px;
}

.login-secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
    box-shadow: 5px 5px 0px 0px rgba(255, 255, 255, 0.3) !important;
}

/* ========================================
   OTP INFO SECTION
======================================== */
.login-otp-info {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-otp-sent-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    margin-bottom: 8px;
}

.login-otp-email-display {
    color: #FED638;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
    word-break: break-all;
}

.login-otp-hint {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    font-style: italic;
    margin-top: 10px;
}

/* ========================================
   RESEND OTP SECTION
======================================== */
.login-resend-section {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.login-resend-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    margin-bottom: 10px;
    font-weight: 400;
}

.login-resend-button {
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 10px 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: not-allowed;
    transition: all 0.3s ease;
    font-family: 'Kanit', sans-serif;
    width: 100%;
    max-width: 200px;
}

.login-resend-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-resend-button.active,
.login-resend-button:not(:disabled) {
    background: rgba(254, 214, 56, 0.1);
    color: #FED638;
    border-color: #FED638;
    cursor: pointer;
    animation: pulse 2s ease-in-out infinite;
}

.login-resend-button.active:hover,
.login-resend-button:not(:disabled):hover {
    background: rgba(254, 214, 56, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(254, 214, 56, 0.3);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(254, 214, 56, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(254, 214, 56, 0);
    }
}

.login-resend-timer {
    display: inline-block;
    font-weight: 600;
}

/* ========================================
   ACTION LINKS
======================================== */
.login-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    margin-top: 50px;
    padding-top: 40px;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
}

.login-action-link {
    position: relative;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.login-action-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(254, 214, 56, 0.2), transparent);
    transition: left 0.5s ease;
}

.login-action-link:hover::before {
    left: 100%;
}

.login-action-link span {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
}

.login-action-link:hover {
    color: #FED638;
    border-color: #FED638;
    background: rgba(254, 214, 56, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(254, 214, 56, 0.3);
}

.login-action-link:hover span {
    color: rgba(255, 255, 255, 0.9);
}

/* Register Link */
.login-action-link:first-child {
    background: rgba(231, 36, 59, 0.1);
    border-color: rgba(231, 36, 59, 0.3);
}

.login-action-link:first-child:hover {
    background: rgba(231, 36, 59, 0.2);
    border-color: #E7243B;
    color: #ffffff;
    box-shadow: 0 5px 15px rgba(231, 36, 59, 0.4);
}

/* Back to Home Link */
.login-action-link:last-child {
    background: rgba(64, 138, 238, 0.1);
    border-color: rgba(64, 138, 238, 0.3);
}

.login-action-link:last-child:hover {
    background: rgba(64, 138, 238, 0.2);
    border-color: #408aee;
    color: #ffffff;
    box-shadow: 0 5px 15px rgba(64, 138, 238, 0.4);
}

/* ========================================
   RESPONSIVE - TABLET
======================================== */
@media (max-width: 768px) {
    .login-main-title {
        font-size: 2.5rem;
    }
    
    .login-subtitle {
        font-size: 1.1rem;
        margin-bottom: 40px;
    }
    
    .login-form-container {
        padding: 30px 20px;
    }
    
    .login-input,
    .login-label {
        font-size: 1.1rem;
    }
    
    .login-submit-button {
        padding: 14px 60px;
        font-size: 1.1rem;
    }
    
    .login-float-img {
        width: 60px;
        height: 60px;
    }
    
    .login-action-link {
        font-size: 1rem;
        padding: 10px 25px;
    }
    
    .login-otp-email-display {
        font-size: 1.1rem;
    }
}

/* ========================================
   RESPONSIVE - MOBILE
======================================== */
@media (max-width: 480px) {
    .login-hero {
        padding: 20px 15px;
    }
    
    .login-main-title {
        font-size: 2rem;
    }
    
    .login-subtitle {
        font-size: 1rem;
    }
    
    .login-form-container {
        padding: 25px 15px;
    }
    
    .login-input,
    .login-label {
        font-size: 1rem;
    }
    
    .login-submit-button {
        padding: 12px 40px;
        font-size: 1rem;
        min-width: 180px;
    }
    
    .login-float-img {
        width: 50px;
        height: 50px;
    }
    
    .login-action-link {
        font-size: 0.95rem;
        padding: 10px 20px;
        width: 90%;
        justify-content: center;
    }
    
    .login-actions {
        gap: 15px;
        margin-top: 40px;
        padding-top: 30px;
    }
    
    .login-otp-email-display {
        font-size: 1rem;
    }
    
    .login-otp-hint {
        font-size: 0.85rem;
    }
    
    .login-resend-button {
        max-width: 180px;
        font-size: 0.95rem;
        padding: 8px 20px;
    }
}

/* ========================================
   PRINT STYLES
======================================== */
@media print {
    .login-hero-bg,
    .login-floating-images,
    .login-floating-elements {
        display: none;
    }
}


/* ========================================
   MOBILE OPTIMIZATION - ปรับปุ่มให้ใกล้กัน
======================================== */

/* ลด gap ระหว่าง form elements บน mobile */
@media (max-width: 768px) {
    .login-form {
        gap: 20px;
    }
    
    .login-form-group {
        margin-bottom: 20px;
    }
    
    /* ปรับ OTP form ให้กระชับ */
    .login-otp-info {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .login-resend-section {
        margin: 15px 0;
        padding: 12px;
    }
    
    /* ลดระยะห่างปุ่ม */
    .login-submit-button {
        margin: 5px auto 0;
    }
    
    .login-secondary-btn {
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .login-form {
        gap: 15px;
    }
    
    .login-form-group {
        margin-bottom: 15px;
    }
    
    /* ทำให้ form กระชับมาก */
    .login-form-container {
        padding: 20px 15px;
    }
    
    .login-otp-info {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .login-otp-sent-text {
        font-size: 0.9rem;
        margin-bottom: 5px;
    }
    
    .login-otp-email-display {
        font-size: 1rem;
        margin-bottom: 5px;
    }
    
    .login-otp-hint {
        font-size: 0.8rem;
        margin-top: 5px;
    }
    
    .login-resend-section {
        margin: 10px 0;
        padding: 10px;
    }
    
    .login-resend-text {
        font-size: 0.85rem;
        margin-bottom: 8px;
    }
    
    .login-submit-button {
        margin: 5px auto 0;
        padding: 12px 30px;
    }
    
    .login-secondary-btn {
        margin-top: 8px;
    }
    
    /* ลดขนาด title/subtitle บน mobile */
    .login-main-title {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }
    
    .login-subtitle {
        font-size: 0.95rem;
        margin-bottom: 30px;
    }
}