/* Complete CSS file - No Tailwind build required */

/* Reset and base styles */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@100..900&display=swap');

* {
    box-sizing: border-box;
    font-family: 'Noto Sans TC', sans-serif;
}

body {
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

:-ms-input-placeholder,
:-moz-placeholder,
::-webkit-input-placeholder,
::-moz-placeholder {
    font-family: 'Noto Sans TC', sans-serif;
}

/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
input[type=number] {
    -moz-appearance: textfield;
}

/* Dark mode root */
.dark {
    color-scheme: dark;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Background overlay */
.bg-overlay {
    min-height: 100vh;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 2rem 1rem;
}

.dark .bg-overlay {
    background-color: rgba(0, 0, 0, 0.5);
}

/* Logo */
.logo {
    display: block;
    margin: 0 auto 2rem auto;
    width: 240px;
    height: 240px;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
}

@media (min-width: 768px) {
    .logo {
        width: 288px;
        height: 288px;
    }
}

/* Dark mode toggle */
.dark-mode-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: auto;
    margin-bottom: 1rem;
    max-width: max-content;
}

.dark .dark-mode-toggle {
    background: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
}

.dark-mode-toggle:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.dark-mode-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
}

.sun-icon {
    color: #f59e0b;
}

.moon-icon {
    color: #6b7280;
}

.dark .sun-icon {
    display: none;
}

.dark .moon-icon {
    display: block;
    color: #9ca3af;
}

.moon-icon {
    display: none;
}

.dark .moon-icon {
    display: block;
}

/* Form card */
.form-card {
    max-width: 42rem;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #f3f4f6;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
}

.dark .form-card {
    background: rgba(55, 65, 81, 0.95);
    border-color: #4b5563;
}

/* Form elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.dark .form-label {
    color: #e5e7eb;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background: white;
    color: #111827;
    font-size: 1rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dark .form-input,
.dark .form-select,
.dark .form-textarea {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: transparent;
    box-shadow: 0 0 0 2px #3b82f6;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: #9ca3af;
}

.dark .form-input::placeholder,
.dark .form-textarea::placeholder {
    color: #6b7280;
}

/* Amount input with currency */
.amount-wrapper {
    position: relative;
}

.currency-label {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 0.875rem;
    pointer-events: none;
}

.dark .currency-label {
    color: #9ca3af;
}

/* Helper text */
.helper-text {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.dark .helper-text {
    color: #9ca3af;
}

/* Terms section */
.terms-section {
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.dark .terms-section {
    background: #374151;
    border-color: #4b5563;
}

.terms-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.terms-checkbox {
    width: 1rem;
    height: 1rem;
    accent-color: #3b82f6;
    flex-shrink: 0;
}

.terms-label {
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.5;
    text-align: center;
}

.dark .terms-label {
    color: #d1d5db;
}

.terms-link {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.2s ease;
}

.terms-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.dark .terms-link {
    color: #60a5fa;
}

.dark .terms-link:hover {
    color: #93c5fd;
}

/* Submit button */
.submit-btn {
    width: 100%;
    background: linear-gradient(to right, #2563eb, #1d4ed8);
    color: white;
    font-weight: 600;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.submit-btn:hover {
    background: linear-gradient(to right, #1d4ed8, #1e40af);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.submit-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Loading spinner */
.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        rotate: (360deg)
    }
}

/* Validation states */
.error-border {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
}

.success-text {
    color: #059669;
}

.error-text {
    color: #dc2626;
}

.warning-text {
    color: #d97706;
}

.dark .success-text {
    color: #10b981;
}

.dark .error-text {
    color: #f87171;
}

.dark .warning-text {
    color: #fbbf24;
}

/* Character counter */
.char-counter {
    font-size: 0.75rem;
    text-align: right;
    margin-top: 0.25rem;
    color: #9ca3af;
}

.dark .char-counter {
    color: #6b7280;
}

.char-counter.over-limit {
    color: #dc2626;
}

.dark .char-counter.over-limit {
    color: #f87171;
}

/* Optional label */
.optional-label {
    color: #9ca3af;
    font-weight: normal;
}

.dark .optional-label {
    color: #6b7280;
}

/* Responsive design */
@media (max-width: 640px) {
    .bg-overlay {
        padding: 1rem 0.5rem;
    }

    .form-card {
        padding: 1.5rem;
        margin: 0 0.5rem;
    }

    .logo {
        width: 200px;
        height: 200px;
    }
}

/* Focus visible for accessibility */
.form-input:focus-visible,
.form-select:focus-visible,
.form-textarea:focus-visible,
.submit-btn:focus-visible,
.dark-mode-toggle:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Smooth transitions for dark mode */
* {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}