/* ==================== CSS Variables ==================== */
:root {
    --color-navy: #0D1B2A;
    --color-gold: #D4A843;
    --color-gold-light: #F0D080;
    --color-foreground: #E8EDF2;
    --color-success: #64B478;
    --color-error: #EF4444;
    --color-warning: #F59E0B;
    --color-info: #3B82F6;
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.6s ease;
}

/* ==================== Global Styles ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--color-navy);
    color: var(--color-foreground);
    line-height: 1.6;
}

/* ==================== Container ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ==================== Navbar ==================== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: rgba(13, 27, 42, 0.95);
    border-bottom: 1px solid rgba(212, 168, 67, 0.15);
    backdrop-filter: blur(12px);
    padding: 1rem 1.5rem;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 0.25rem;
    background: linear-gradient(135deg, #D4A843, #F0D080);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: bold;
    color: var(--color-navy);
}

.logo-text {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--color-gold-light);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(212, 168, 67, 0.2);
    background-color: transparent;
    color: rgba(232, 237, 242, 0.6);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.logout-btn:hover {
    border-color: rgba(212, 168, 67, 0.5);
    color: var(--color-gold);
}

/* ==================== Hero Section ==================== */
.hero-section {
    position: relative;
    overflow: hidden;
    min-height: 320px;
    background-image: url('https://d2xsxph8kpxj0f.cloudfront.net/310519663405442726/4j6gywqm2ReQKaftNzdzdn/home-hero-JGD9WUrbApemSdAj4uX9Vc.webp');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(13, 27, 42, 0.6) 0%, rgba(13, 27, 42, 0.85) 100%);
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 600px;
    padding: 3rem 1.5rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    background-color: rgba(212, 168, 67, 0.15);
    border: 1px solid rgba(212, 168, 67, 0.3);
    color: var(--color-gold);
    margin-bottom: 1rem;
}

.pulse-dot {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 50%;
    background-color: currentColor;
    animation: pulse 1.5s ease-in-out infinite;
}

.hero-title {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    color: var(--color-foreground);
}

.gold-text {
    color: var(--color-gold);
}

.hero-subtitle {
    font-size: 1rem;
    color: rgba(232, 237, 242, 0.6);
}

/* ==================== Section Headers ==================== */
.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-label {
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--color-gold);
    margin-bottom: 0.75rem;
}

.section-title {
    font-size: 1.875rem;
    font-weight: bold;
    margin-bottom: 0.75rem;
    color: var(--color-foreground);
}

.section-divider {
    width: 96px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
    margin: 1rem auto;
}

.section-description {
    font-size: 0.875rem;
    color: rgba(232, 237, 242, 0.5);
}

/* ==================== Plans Section ==================== */
.plans-section {
    padding: 3rem 0;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.plan-card {
    padding: 1.25rem;
    border-radius: 1rem;
    background-color: rgba(15, 28, 44, 0.8);
    border: 1px solid rgba(212, 168, 67, 0.3);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
}

.plan-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(212, 168, 67, 0.2);
}

.plan-card.selected {
    box-shadow: 0 0 60px rgba(212, 168, 67, 0.3), 0 0 80px rgba(212, 168, 67, 0.2);
    border-color: rgba(212, 168, 67, 0.7);
}

.plan-hot-badge {
    position: absolute;
    top: -12px;
    right: -12px;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: bold;
    background: linear-gradient(135deg, #FF4444, #FF6666);
    color: white;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.6);
}

.plan-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.plan-name {
    font-size: 1.125rem;
    font-weight: bold;
    color: var(--color-foreground);
}

.plan-price {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-gold);
}

.plan-description {
    font-size: 0.875rem;
    line-height: 1.5;
    color: rgba(232, 237, 242, 0.6);
}

/* ==================== Form Section ==================== */
.form-section {
    padding: 3rem 0 5rem;
}

.selected-plan-reminder {
    max-width: 600px;
    margin: 0 auto 2rem;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    background-color: rgba(212, 168, 67, 0.08);
    border: 1px solid rgba(212, 168, 67, 0.3);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.selected-plan-reminder svg {
    flex-shrink: 0;
    color: var(--color-gold);
}

.reminder-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-gold);
}

.reminder-plan {
    color: var(--color-gold);
}

.application-form {
    max-width: 896px;
    margin: 0 auto;
    padding: 2.75rem 3.25rem;
    border-radius: 1rem;
    background-color: rgba(21, 34, 52, 0.8);
    border: 1px solid rgba(212, 168, 67, 0.15);
    backdrop-filter: blur(12px);
}

/* ==================== Step Indicator ==================== */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    transition: all var(--transition-normal);
    border: 1px solid rgba(212, 168, 67, 0.3);
}

.step-item.active .step-circle {
    background: linear-gradient(135deg, #D4A843, #F0D080);
    color: var(--color-navy);
    box-shadow: 0 0 15px rgba(212, 168, 67, 0.4);
}

.step-item.completed .step-circle {
    background-color: rgba(100, 180, 120, 0.8);
    color: var(--color-foreground);
}

.step-item:not(.active):not(.completed) .step-circle {
    background-color: rgba(212, 168, 67, 0.15);
    color: var(--color-gold);
}

.step-label {
    font-size: 0.75rem;
    text-align: center;
    transition: all var(--transition-normal);
}

.step-item.active .step-label,
.step-item.completed .step-label {
    color: var(--color-foreground);
    font-weight: 500;
}

.step-item:not(.active):not(.completed) .step-label {
    color: rgba(232, 237, 242, 0.5);
}

/* ==================== Auto-save Indicator ==================== */
.auto-save-indicator {
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    background-color: rgba(212, 168, 67, 0.1);
    color: var(--color-gold);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ==================== Form Steps ==================== */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeInUp var(--transition-slow);
}

.step-title {
    font-size: 1.125rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
    color: var(--color-foreground);
}

.step-subtitle {
    font-size: 0.875rem;
    margin-top: 0.75rem;
    margin-bottom: 1.5rem;
    color: rgba(232, 237, 242, 0.5);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.6rem 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: rgba(232, 237, 242, 0.7);
}

.phone-number-group {
    display: flex;
    gap: 1rem;
}

.country-code-field {
    flex: 0 0 160px;
}

.phone-number-group .form-input {
    min-width: 0;
    flex: 1 1 auto;
}

.form-label .required {
    color: var(--color-error);
    margin-left: 0.25rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    min-height: 64px;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background-color: rgba(13, 27, 42, 0.8);
    border: 1px solid rgba(212, 168, 67, 0.2);
    color: var(--color-foreground);
    font-family: inherit;
    transition: all var(--transition-normal);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: rgba(212, 168, 67, 0.5);
    box-shadow: 0 0 0 2px rgba(212, 168, 67, 0.1);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: var(--color-error);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}

.form-error {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: var(--color-error);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23D4A843' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

.upload-field {
    position: relative;
}

.upload-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    background-color: rgba(13, 27, 42, 0.8);
    border: 1px solid rgba(212, 168, 67, 0.2);
}

.upload-box.has-file {
    background-color: rgba(212, 168, 67, 0.08);
    border-color: rgba(212, 168, 67, 0.5);
}

.upload-box.error {
    border-color: var(--color-error);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}

.upload-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    color: rgba(212, 168, 67, 0.5);
}

.upload-box.has-file .upload-icon {
    color: var(--color-gold);
}

.upload-text {
    font-size: 0.875rem;
    color: rgba(232, 237, 242, 0.35);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-box.has-file .upload-text {
    color: var(--color-gold);
}

.upload-remove {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    background-color: rgba(232, 237, 242, 0.1);
    color: rgba(232, 237, 242, 0.5);
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.upload-remove:hover {
    background-color: rgba(232, 237, 242, 0.15);
    color: rgba(232, 237, 242, 0.7);
}

.upload-input {
    display: none;
}

.upload-hint {
    font-size: 0.75rem;
    color: rgba(232, 237, 242, 0.4);
    margin-top: 0.375rem;
}

/* ==================== Video Info ==================== */
.video-info {
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background-color: rgba(212, 168, 67, 0.06);
    border: 1px solid rgba(212, 168, 67, 0.2);
}

.video-info-icon {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.125rem;
    flex-shrink: 0;
    color: var(--color-gold);
}

.video-info-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-gold);
}

.video-info-list {
    list-style: none;
    margin-top: 0.5rem;
    space-y: 0.25rem;
}

.video-info-list li {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(232, 237, 242, 0.5);
    margin-top: 0.25rem;
}

.video-info-list li::before {
    content: '·';
    color: var(--color-gold);
}

/* ==================== Form Navigation ==================== */
.form-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 1.5rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(212, 168, 67, 0.1);
}

.nav-left,
.nav-right {
    display: flex;
    gap: 0.75rem;
}

/* ==================== Buttons ==================== */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #D4A843, #F0D080);
    color: var(--color-navy);
}

.btn-primary:hover {
    box-shadow: 0 0 20px rgba(212, 168, 67, 0.3);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: rgba(212, 168, 67, 0.1);
    color: var(--color-gold);
    border: 1px solid rgba(212, 168, 67, 0.3);
}

.btn-secondary:hover {
    background-color: rgba(212, 168, 67, 0.15);
    border-color: rgba(212, 168, 67, 0.5);
}

/* ==================== LINE Button ==================== */
.line-button {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 40;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #00B900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 185, 0, 0.4);
    transition: all var(--transition-normal);
    text-decoration: none;
}

.line-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 185, 0, 0.5);
}

/* ==================== Footer ==================== */
.footer {
    padding: 2rem 1.5rem;
    text-align: center;
    border-top: 1px solid rgba(212, 168, 67, 0.1);
    background-color: rgba(10, 20, 32, 0.8);
}

.footer-text {
    font-size: 0.75rem;
    color: rgba(232, 237, 242, 0.3);
}

/* ==================== Animations ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ==================== Responsive Design ==================== */
@media (max-width: 768px) {
    .hero-title {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .plans-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-nav {
        flex-direction: column;
    }

    .nav-left,
    .nav-right {
        width: 100%;
        justify-content: center;
    }

    .btn {
        width: 100%;
    }

    .step-indicator {
        gap: 0.5rem;
    }

    .step-label {
        font-size: 0.65rem;
    }

    .step-circle {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .hero-content {
        padding: 2rem 1rem;
    }

    .hero-title {
        font-size: 1.25rem;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .application-form {
        padding: 1rem;
    }

    .navbar-logo {
        gap: 0.5rem;
    }

    .logo-text {
        font-size: 0.875rem;
    }

    .logout-btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
}

/* new */
.input-focus-effect:focus {
    border-bottom-color: var(--brand-color);
    transition: border-color 0.3s ease;
}
/* Legacy JS visibility toggle */
.none { display: none !important; }
/* Compatibility styles for legacy JS error handling */
.JqBlock:not(.error) .JqError { display: none; }
.JqAccessError:not(.error) { display: none; }
.JqError, .JqAccessError{ color: rgb(239, 68, 68) }

/* Popup visibility when active */
.JqPopupBox.active { display: flex !important; }

/* OTP button disabled state during cooldown */
.JqRegisterGetOtp.otp-cooldown {
    pointer-events: none;
    opacity: 0.4;
    cursor: not-allowed;
}

/* Toast notification */
.otp-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: #16a34a;
    color: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.otp-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.line-gradient {
    background: linear-gradient(135deg, #00C300 0%, #00E000 100%);
}
.line-gradient:hover {
    background: linear-gradient(135deg, #00A300 0%, #00C300 100%);
}
:root { --brand-color: <?= $theme['primary'] ?>; }
.dark .input-focus-effect {
    color: #f3f4f6;
    border-color: #4b5563;
}

/* Container for input + button/countdown */
.form-group .relative {
  position: relative;
  width: 100%;
}

/* Input field – reserve space on the right for the button/text */
.form-group .form-input {
  width: 100%;
  /* padding-right: 7rem;   */
  /* Adjust based on your button/text width */
  box-sizing: border-box;
}

/* Button and countdown container – vertically centered, right-aligned */
.form-group .JqRegisterGetOtp,
.form-group .JqRegisterRegetOtp {
  position: absolute;
  right: 0.75rem;       /* same as right-3 */
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  white-space: nowrap;  /* prevent text wrapping */
}

/* Button specific styling (optional, improves appearance) */
.form-group .JqRegisterGetOtp {
  background: none;
  border: none;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.875rem;  /* text-sm */
  color: var(--color-gold);
  padding: 0;
}

.form-group .JqRegisterGetOtp:hover {
  color: var(--color-gold);
}

/* Countdown text styling */
.form-group .JqRegisterRegetOtp {
  color: #9ca3af;       /* gray-400 */
  font-weight: bold;
  font-size: 0.875rem;
  pointer-events: none; /* not clickable */
}

/* Error message spacing remains unchanged */
.form-group .JqError {
  margin-top: 0.25rem;
}

/* For Chrome, Safari, Edge, Opera */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* For Firefox */
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield; /* standard property for future compatibility */
}

.bg-login{
    background-image: url('/images/landing/login.png') !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
}

/* ==================== Pending Order Section ==================== */
.pending-order-section {
    padding: 6rem 0;
    background: linear-gradient(135deg, var(--color-navy) 0%, #1a2332 100%);
}

.pending-order-card {
    max-width: 600px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(212, 168, 67, 0.2);
    border-radius: 1.5rem;
    padding: 3rem 2rem;
    text-align: center;
    backdrop-filter: blur(12px);
}

.pending-order-icon {
    color: var(--color-gold);
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.pending-order-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-foreground);
    margin-bottom: 1rem;
}

.pending-order-description {
    font-size: 1.1rem;
    color: rgba(232, 237, 242, 0.8);
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

.pending-order-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.pending-order-actions .btn {
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 500;
}