﻿/* LAWKKU Login Form - Complete & Self-Contained */

:root {
    --law-blue: #C0C0C0;
    --law-blue-dark: #909090;
    --law-blue-deep: #707070;
    --law-gold: #C0C0C0;
    --law-gold-dark: #909090;
    --law-gold-soft: rgba(192,192,192,.15);
    --law-blue-soft: rgba(192,192,192,.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
    background: linear-gradient(135deg, #ffffff 0%, #F5F5F5 55%, #f8f5ed 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.6;
    position: relative;
    font-family: 'SukhumvitSet', sans-serif;
    overflow: hidden;
    font-family: "Sukhumvit Set", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
     margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: "Sukhumvit Set", sans-serif;
    background: #ffffff url("img/ST2.png") no-repeat right bottom;
    background-size: 50%; /* กำหนดให้กินพื้นที่จอแค่ 35% */
}

/* Natural Background Elements */
.nature-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.floating-leaf {
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(ellipse at center, #ECECEC, var(--law-gold));
    border-radius: 0 100% 0 100%;
    opacity: 0.4;
    animation: floatLeaf 8s ease-in-out infinite;
}

.leaf-1 {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
    transform: rotate(45deg);
}

.leaf-2 {
    top: 60%;
    left: 85%;
    animation-delay: 2s;
    transform: rotate(-30deg);
}

.leaf-3 {
    top: 80%;
    left: 15%;
    animation-delay: 4s;
    transform: rotate(60deg);
}

.leaf-4 {
    top: 30%;
    left: 75%;
    animation-delay: 6s;
    transform: rotate(-45deg);
}

@keyframes floatLeaf {
    0%, 100% { transform: translateY(0) rotate(var(--rotation, 0deg)); opacity: 0.4; }
    50% { transform: translateY(-20px) rotate(calc(var(--rotation, 0deg) + 10deg)); opacity: 0.7; }
}

.login-container {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}

/*การ์ด*/
.wellness-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(112,112,112,.28);
    border-radius: 32px;
    padding: 48px 40px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.68), 0 20px 44px rgba(112,112,112,.18);
}

/* แสงบนการ์ด*/
.organic-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #E8E8E8, #dbdd77, #e0e962, #ecee93, #d89401);
    background-size: 200% 100%;
    animation: organicFlow 4s ease-in-out infinite;
    border-radius: 32px 32px 0 0;
}
/* แสงบนการ์ด*/
@keyframes organicFlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.mindful-header {
    text-align: center;
    margin-bottom: 40px;
}



/* Organic Form Fields */
.organic-field {
    position: relative;
    margin-bottom: 32px;
    isolation: isolate;
}

.field-nature {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(192,192,192,.15);
    border: 2px solid rgba(112,112,112,.28);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.organic-field::after {
    content: '';
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: -6px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, var(--law-gold), var(--law-gold-dark), transparent);
    opacity: 0;
    transform: scaleX(.25);
    transform-origin: center;
    transition: opacity .22s ease, transform .28s ease;
    z-index: 1;
}

.organic-field input {
    width: 100%;
    background: transparent;
    border: none;
    padding: 18px 60px 18px 20px;
    color: #000000;
    font-size: 16px;
    font-weight: 400;
    outline: none;
    position: relative;
    z-index: 2;
    font-family: inherit;
}

.organic-field input::placeholder {
    color: transparent;
}

.organic-field label {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--law-gold);
    font-size: 16px;
    font-weight: 400;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 3;
    background: rgba(255, 255, 255, 0.9);
    padding: 0 8px;
}

.organic-field input:focus + label,
.organic-field input:not(:placeholder-shown) + label {
    top: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--law-gold-dark);
    transform: translateY(-50%);
}
/*เปลี่ยนสี ข้อความในกล่อง */
.organic-field:focus-within .field-nature {
    border-color: var(--law-gold);
    background: rgba(255,255,255,.72);
    box-shadow: 0 0 0 4px rgba(192,192,192,.16), 0 10px 24px rgba(112,112,112,.08);
    transform: translateY(-1px);
}

.organic-field:focus-within::after {
    opacity: .85;
    transform: scaleX(1);
}

.organic-field.is-typing .field-nature {
    animation: inputBreath .7s ease-out;
}

.organic-field.is-typing::after {
    animation: typingLine .7s ease-out;
}

.organic-field.has-value .field-nature {
    border-color: rgba(112,112,112,.42);
}

@keyframes inputBreath {
    0% { box-shadow: 0 0 0 0 rgba(192,192,192,.24), 0 8px 18px rgba(112,112,112,.05); }
    45% { box-shadow: 0 0 0 6px rgba(192,192,192,.18), 0 12px 28px rgba(112,112,112,.1); }
    100% { box-shadow: 0 0 0 3px rgba(192,192,192,.12), 0 10px 24px rgba(112,112,112,.08); }
}

@keyframes typingLine {
    0% { opacity: 0; transform: scaleX(.25); }
    40% { opacity: 1; transform: scaleX(1); }
    100% { opacity: .85; transform: scaleX(1); }
}

.growth-indicator {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    z-index: 4;
}

.leaf-sprout {
    width: 100%;
    height: 100%;
    background: var(--law-gold);
    border-radius: 0 100% 0 100%;
    opacity: 0;
    transform: scale(0) rotate(45deg);
    animation: sproutGrow 0.5s ease-out forwards;
}

.organic-field input:focus ~ .growth-indicator .leaf-sprout,
.organic-field input:valid ~ .growth-indicator .leaf-sprout {
    opacity: 1;
    transform: scale(1) rotate(45deg);
}

@keyframes sproutGrow {
    0% { opacity: 0; transform: scale(0) rotate(45deg); }
    100% { opacity: 1; transform: scale(1) rotate(45deg); }
}

/* Nature Toggle */
.organic-field:has(.nature-toggle) input {
    padding-right: 56px;
}

.nature-toggle {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--law-gold);
    padding: 8px;
    border-radius: 12px;
    transition: all 0.3s ease;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nature-toggle:hover {
    color: var(--law-gold-dark);
    background: rgba(192,192,192,.15);
}

.eye-hidden {
    display: none;
}

.nature-toggle.toggle-visible .eye-visible {
    display: none;
}

.nature-toggle.toggle-visible .eye-hidden {
    display: block;
}

/* Mindful Options */
.mindful-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 36px;
    flex-wrap: wrap;
    gap: 16px;
}


.leaf-shape {
    width: 100%;
    height: 100%;
    background: rgba(192,192,192,.15);
    border: 1.5px solid rgba(192,192,192,.15);
    border-radius: 0 100% 0 100%;
    transform: rotate(45deg);
    transition: all 0.3s ease;
    position: absolute;
}

.healing-link {
    color: var(--law-gold);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.healing-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--law-blue-deep), var(--law-blue-dark));
    transition: width 0.3s ease;
}

.healing-link:hover::after {
    width: 100%;
}

.healing-link:hover {
    color: var(--law-gold-dark);
}

/* ปรับ BT เข้าสู่ระบบ */
.harmony-button {
    width: 100%;
    background: transparent;
    color: #ffffff;
    border: 2px solid rgba(112,112,112,.34);
    border-radius: 20px;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    position: relative;
    margin-bottom: 32px;
    overflow: hidden;
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: transform .22s ease, opacity .22s ease, filter .22s ease;
}
/* ปรับสี BT เข้าสู่ระบบ */
.button-earth {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--law-gold), var(--law-gold-dark));
    border-radius: 18px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.45), 0 8px 18px rgba(112,112,112,.18);
    transition: all 0.3s ease;
}

.harmony-button:hover .button-earth {
    background: linear-gradient(135deg, var(--law-gold), var(--law-gold-dark));
    transform: scale(1.02);
}

.harmony-button:active .button-earth {
    transform: scale(0.98);
}

.button-text {
    position: relative;
    z-index: 2;
    transition: opacity 0.3s ease, transform .25s ease;
}

.button-growth {
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.3s ease;
    display: flex;
    gap: 6px;
    width: 0;
    overflow: hidden;
}

.growing-circle {
    width: 8px;
    height: 8px;
    background: #ffffff;
    border-radius: 50%;
    animation: organicGrow 1.5s ease-in-out infinite;
}

.circle-2 { animation-delay: 0.2s; }
.circle-3 { animation-delay: 0.4s; }

@keyframes organicGrow {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.6; }
    40% { transform: scale(1.2); opacity: 1; }
}

.harmony-button.loading {
    cursor: wait;
    filter: saturate(.92);
    transform: translateY(1px);
}

.harmony-button.loading .button-earth {
    background: linear-gradient(110deg, var(--law-gold-dark), var(--law-gold), var(--law-blue-deep));
    background-size: 220% 100%;
    animation: loginFlow 1.25s ease-in-out infinite;
}

.harmony-button.loading .button-text {
    opacity: 1;
    transform: translateX(-2px);
}

.harmony-button.loading .button-growth {
    opacity: 1;
    width: 36px;
    transform: translateX(0);
}

.harmony-button:disabled {
    pointer-events: none;
}

@keyframes loginFlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.button-aura {
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(135deg, #ECECEC, var(--law-gold));
    border-radius: 23px;
    opacity: 0;
    filter: blur(12px);
    transition: opacity 0.3s ease;
    z-index: -1;
}

.harmony-button:hover .button-aura {
    opacity: 0.6;
}

/* Balance Divider */
.balance-divider {
    display: flex;
    align-items: center;
    margin: 32px 0;
    gap: 16px;
}

.divider-branch {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(192,192,192,.15), transparent);
}

.divider-center {
    color: var(--law-gold);
    opacity: 0.7;
    animation: centerPulse 3s ease-in-out infinite;
}

@keyframes centerPulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}


/* Gentle Error */
.gentle-error {
    color: #ff7043;
    font-size: 12px;
    font-weight: 500;
    margin-top: 8px;
    opacity: 0;
    transform: translateY(-4px);
    transition: all 0.3s ease;
    position: relative;
    z-index: 5;
}


/* Harmony Success */
.harmony-success {
    display: none;
    text-align: center;
    padding: 40px 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.harmony-success.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.success-mandala {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mandala-ring {
    position: absolute;
    border: 2px solid var(--law-gold);
    border-radius: 50%;
    animation: mandalaGrow 1.2s ease-out forwards;
    opacity: 0;
}

.ring-1 {
    width: 60px;
    height: 60px;
    top: 15px;
    left: 15px;
    animation-delay: 0s;
}

.ring-2 {
    width: 75px;
    height: 75px;
    top: 7.5px;
    left: 7.5px;
    animation-delay: 0.2s;
}

.ring-3 {
    width: 90px;
    height: 90px;
    top: 0;
    left: 0;
    animation-delay: 0.4s;
}

@keyframes mandalaGrow {
    0% { opacity: 0; transform: scale(0) rotate(0deg); }
    50% { opacity: 1; transform: scale(1.1) rotate(180deg); }
    100% { opacity: 0.8; transform: scale(1) rotate(360deg); }
}

.mandala-center {
    position: relative;
    z-index: 2;
    color: var(--law-gold);
    animation: centerBloom 0.8s ease-out 0.6s forwards;
    opacity: 0;
}

@keyframes centerBloom {
    0% { opacity: 0; transform: scale(0); }
    100% { opacity: 1; transform: scale(1); }
}

.harmony-success h3 {
    color: var(--law-gold-dark);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.harmony-success p {
    color: var(--law-gold);
    font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    body {
        padding: 16px;
    }
    
    .wellness-card {
        padding: 36px 28px;
        border-radius: 24px;
    }
    
    .mindful-header h1 {
        font-size: 1.75rem;
    }
    
    .zen-logo {
        width: 60px;
        height: 60px;
    }
    
    .mindful-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .natural-social {
        flex-direction: column;
    }
    
    .floating-leaf {
        width: 16px;
        height: 16px;
    }
}
