/* ==========================================
   DARK LUXURY SAPPHIRE THEME (RAGNAROK ONLINE)
   ========================================== */
:root {
    --ro-primary: #2ecc71;         /* สีฟ้าไพลินหลัก */
    --ro-primary-hover: #58d68d;   /* สีฟ้าไพลินสว่างเมื่อ Hover */
    --ro-secondary: #1abc9c;       /* สีน้ำเงินพรีเมียม */
    --ro-bg: #0d1117;              /* พื้นหลังสไตล์ Dark Mode เข้มขรึม */
    --ro-card-bg: #161b22;         /* พื้นหลังกล่อง/การ์ด */
    --ro-border: #30363d;          /* ขอบกรอบสีเทาเข้ม */
    --ro-border-accent: #2ecc71;   /* ขอบกรอบสีเงินพลาตินัม */
    --ro-glass: rgba(22, 27, 34, 0.85);
    --ro-glass-border: rgba(88, 166, 255, 0.3);
    --text-main: #e6edf3;          /* ตัวอักษรสีขาวสว่าง */
    --text-muted: #8b949e;         /* ตัวอักษรสีเทาอ่านง่าย */
    --font-family: 'Sarabun', sans-serif;
    --font-heading: 'Mali', cursive;
}

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

html {
    font-size: 16px;
}

@media (min-width: 2560px) { html { font-size: 18px; } }
@media (min-width: 3840px) { html { font-size: 22px; } }

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: var(--font-family);
    background-color: var(--ro-bg);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--ro-primary);
    font-weight: 700;
}

a {
    color: var(--ro-primary-hover);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: #ffffff;
}

.ro-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================
   NAVIGATION BAR
   ========================================== */
.luxury-nav {
    background: linear-gradient(135deg, #161b22 0%, #0d1117 100%);
    backdrop-filter: blur(15px);
    border-bottom: 3px solid var(--ro-border-accent);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    gap: 40px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-shield {
    background: #1f242d;
    padding: 8px;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(56, 139, 253, 0.3);
    border: 2px solid var(--ro-border-accent);
}

.nav-logo img {
    height: 45px;
    display: block;
    animation: bounceLogo 3s ease-in-out infinite;
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--ro-primary);
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
    white-space: nowrap;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 15px;
    align-items: center;
}

.nav-link-std {
    color: var(--text-main);
    font-weight: 600;
    font-size: 1.05rem;
    padding: 10px 18px;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.nav-link-std i {
    color: var(--ro-primary);
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.nav-link-std:hover {
    color: #ffffff;
    background: rgba(56, 139, 253, 0.15);
    transform: translateY(-2px);
}

.nav-link-std:hover i {
    color: var(--ro-primary-hover);
    transform: scale(1.2);
}

.nav-btn-special {
    background: linear-gradient(135deg, #1f6feb 0%, #238636 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 1.05rem;
    padding: 10px 24px;
    border-radius: 30px;
    border: 1px solid #3fb950;
    box-shadow: 0 4px 12px rgba(35, 134, 54, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.nav-btn-special:hover {
    color: #ffffff;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(63, 185, 80, 0.6);
}

.hamburger {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--ro-primary);
    background: #f17360;
    padding: 5px 12px;
    border-radius: 8px;
    border: 1px solid var(--ro-border);
}

/* ==========================================
   MAIN CONTENT & BACKGROUND OVERLAY
   ========================================== */
.main-content {
    flex: 1;
    background-image: url('../img/bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    overflow: hidden;
}

.main-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* ปรับค่า 0.8 และ 0.9 ด้านล่าง ให้ลดลงเหลือประมาณ 0.3 - 0.5 */
    background: linear-gradient(180deg, rgba(13, 17, 23, 0.4) 0%, rgba(13, 17, 23, 0.6) 100%);
    z-index: 1;
}

.register-wrapper {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
}

/* Mascot Floating Animations */
.mascot-container {
    display: none;
    position: relative;
    width: 280px;
    height: 500px;
}

@media (min-width: 1024px) {
    .mascot-container { display: block; }
}

.floating-char {
    position: absolute;
    top: 50px;
    width: 100%;
    max-width: 250px;
    filter: drop-shadow(0 15px 20px rgba(0,0,0,0.6));
    animation: floatChar 5s ease-in-out infinite;
    z-index: 2;
}

.floating-pet {
    position: absolute;
    width: 80px;
    filter: drop-shadow(0 8px 10px rgba(0,0,0,0.5));
    z-index: 3;
}

.pet-1 { bottom: 50px; left: -20px; animation: hop 3s ease-in-out infinite; }
.pet-2 { top: 20px; right: -20px; animation: floatPet 4s ease-in-out infinite alternate; width: 100px; }
.pet-3 { bottom: 80px; right: -30px; animation: hop 2.5s ease-in-out infinite 0.5s; }

@keyframes floatChar { 0%, 100% { transform: translateY(0px); } 50% { transform: translateY(-15px); } }
@keyframes floatPet { 0% { transform: translateY(0px) rotate(-5deg); } 100% { transform: translateY(-20px) rotate(5deg); } }
@keyframes hop {
    0%, 100% { transform: translateY(0) scale(1, 1); }
    10% { transform: translateY(0) scale(1.1, 0.9); }
    30% { transform: translateY(-30px) scale(0.9, 1.1); }
    50% { transform: translateY(0) scale(1, 1); }
}

/* ==========================================
   LUXURY WINDOW & MODALS
   ========================================== */
.luxury-window {
    width: 100%;
    max-width: 550px;
    background: var(--ro-card-bg);
    border: 2px solid var(--ro-border-accent);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    position: relative;
    animation: popIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
    0% { opacity: 0; transform: scale(0.9) translateY(30px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.window-header {
    background: linear-gradient(135deg, #1b2a47 0%, #2c4373 100%);
    padding: 25px 20px 15px;
    text-align: center;
    border-bottom: 1px solid var(--ro-border);
}

.window-header h2 {
    font-size: 2.2rem;
    margin: 0;
    color: var(--ro-primary);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.window-header .subtitle {
    color: var(--ro-primary-hover);
    font-weight: 500;
    margin-top: 5px;
    font-size: 1.1rem;
}

.window-content {
    padding: 35px;
    background: var(--ro-bg);
}

/* Form Styles */
.form-group { margin-bottom: 22px; }
.form-row { display: flex; gap: 20px; }
.form-group.half { width: 50%; }

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--ro-primary);
    font-size: 1.05rem;
}

label i {
    color: var(--ro-primary-hover);
    width: 25px;
    text-align: center;
    margin-right: 5px;
}

.form-control {
    width: 100%;
    padding: 12px 18px;
    background: #161b22;
    border: 1px solid var(--ro-border);
    border-radius: 12px;
    color: #ffffff;
    font-family: var(--font-family);
    font-size: 1.05rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--ro-secondary);
    background: #1f242d;
    box-shadow: 0 0 0 4px rgba(56, 139, 253, 0.2);
    transform: translateY(-2px);
}

.form-control::placeholder { color: var(--text-muted); }

.agreement-group {
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px dashed var(--ro-border);
    margin-bottom: 25px;
}

.agreement-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-main);
    font-weight: 500;
}

.agreement-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--ro-secondary);
}

/* Captcha Refresh Button */
.captcha-wrapper { display: flex; gap: 12px; align-items: center; }
.captcha-img { border-radius: 8px; border: 1px solid var(--ro-border); height: 48px; }
.btn-refresh {
    background: #161b22;
    border: 1px solid var(--ro-border);
    color: var(--ro-primary);
    width: 48px;
    height: 48px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}
.btn-refresh:hover {
    background: var(--ro-secondary);
    color: #fff;
    border-color: var(--ro-secondary);
    transform: rotate(180deg) scale(1.1);
}

/* Buttons */
.form-actions { margin-top: 35px; text-align: center; }
.btn-luxury {
    background: linear-gradient(135deg, #1f6feb 0%, #238636 100%);
    color: #ffffff;
    border: 1px solid #3fb950;
    padding: 16px 32px;
    font-size: 1.4rem;
    font-family: var(--font-heading);
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    text-transform: uppercase;
    box-shadow: 0 10px 20px rgba(35, 134, 54, 0.3);
}

.btn-luxury:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 25px rgba(63, 185, 80, 0.5);
    color: #ffffff;
}

/* ==========================================
   FOOTER SECTION
   ========================================== */
.luxury-footer {
    background: #0d1117;
    position: relative;
    padding: 60px 0 0 0;
    border-top: 4px solid var(--ro-border-accent);
    color: var(--text-main);
}

.footer-decoration {
    position: absolute;
    top: -50px;
    right: 10%;
    z-index: 10;
}

.footer-pet {
    width: 100px;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5));
    animation: bounceLogo 3s ease-in-out infinite;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}

.footer-brand h3 {
    color: var(--ro-primary);
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.footer-logo-img { height: 40px; }
.footer-brand p { color: var(--text-muted); font-size: 1rem; max-width: 400px; line-height: 1.8; }

.footer-links h4, .footer-social h4 {
    color: #ffffff;
    font-size: 1.2rem;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.footer-links h4::after, .footer-social h4::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--ro-primary);
}

.social-icons { display: flex; gap: 15px; }
.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: #161b22;
    border: 1px solid var(--ro-border);
    border-radius: 50%;
    color: #fff;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.social-icon:hover { transform: translateY(-5px); color: #fff; }
.social-icon.fb:hover { background: #1877F2; border-color: #1877F2; box-shadow: 0 5px 15px rgba(24,119,242,0.4); }
.social-icon.discord:hover { background: #5865F2; border-color: #5865F2; box-shadow: 0 5px 15px rgba(88,101,242,0.4); }
.social-icon.line:hover { background: #00B900; border-color: #00B900; box-shadow: 0 5px 15px rgba(0,185,0,0.4); }

.footer-bottom {
    border-top: 1px solid var(--ro-border);
    padding: 20px 0;
    text-align: center;
}
.footer-bottom p { color: var(--text-muted); margin: 5px 0; }
.footer-bottom .highlight { color: var(--ro-primary); font-weight: 700; }

/* Global RO Modal Overlay */
.ro-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

/* ==========================================
   RESPONSIVE DESIGN (MOBILE & TABLET)
   ========================================== */
@media (max-width: 1024px) {
    .form-row { flex-direction: column; gap: 0; }
    .form-group.half { width: 100%; }
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background: #161b22;
        padding: 20px 0;
        text-align: center;
        border-bottom: 3px solid var(--ro-border-accent);
    }
    .nav-links.active { display: flex; }
    .hamburger { display: block; }
    .footer-grid { grid-template-columns: 1fr; gap: 30px; text-align: center; }
    .footer-brand, .footer-links, .footer-social { display: flex; flex-direction: column; align-items: center; }
    .footer-decoration { right: 50%; transform: translateX(50%); }
}

@media (max-width: 480px) {
    .register-wrapper { gap: 20px; }
    .window-header h2 { font-size: 1.6rem; }
    .window-content { padding: 20px; }
    .form-control { padding: 10px 15px; font-size: 1rem; }
}

/* ==========================================
   FIX: REGISTER FORM TEXT CONTRAST ENHANCEMENTS
   ========================================== */

/* 1. ปรับ Label ข้อความกำกับช่องให้สว่าง คมชัด */
.window-content label {
    color: #79c0ff !important; /* ฟ้าไพลินสว่าง */
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* 2. ปรับช่องกรอกข้อมูล (Input) พื้นหลังเข้มขึ้น ตัวอักษรสีขาวบริสุทธิ์ */
.window-content .form-control {
    background-color: #0b0e14 !important; /* พื้นหลังช่องกรอกเข้มขึ้นเพื่อให้ตัวหนังสือลอยออกมา */
    color: #ffffff !important;           /* ตัวอักษรขณะพิมพ์ใช้สีขาวบริสุทธิ์ */
    border: 1px solid #484f58 !important; /* เพิ่มเส้นขอบให้เห็นขอบเขตชัดเจน */
    font-size: 1.05rem;
}

/* 3. ปรับสีตัวหนังสือตัวอย่าง (Placeholder) ให้สว่าง อ่านออกง่าย */
.window-content .form-control::placeholder {
    color: #a5d6ff !important;
    opacity: 0.7;
}

/* 4. เมื่อคลิกช่องกรอก (Focus) ให้สว่างชัดเจนยิ่งขึ้น */
.window-content .form-control:focus {
    background-color: #121721 !important;
    border-color: #58a6ff !important;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.3) !important;
}

/* 5. ปรับข้อความยินยอม / ข้อความกำกับอื่นๆ (Agreement) */
.agreement-group {
    background: rgba(13, 17, 23, 0.8) !important;
    border: 1px solid #30363d !important;
}

.agreement-label {
    color: #f0f6fc !important; /* ตัวอักษรข้อตกลงสีขาวนวล */
    font-weight: 600;
}