/* =====================================================
   Ramen Networks Captive Portal - Clean Light Design
   ===================================================== */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --accent: #f97316;
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-focus: #6366f1;
    --success: #10b981;
    --success-bg: #d1fae5;
    --error: #ef4444;
    --error-bg: #fee2e2;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

.background-pattern {
    display: none;
}

.container {
    width: 100%;
    max-width: 400px;
}

/* Card Styling */
.portal-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: slideUp 0.5s ease-out;
}

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

/* Logo Section - Light Background */
.logo-section {
    background: #ffffff;
    padding: 24px 20px 16px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.logo {
    max-width: 140px;
    height: auto;
}

/* Header - Compact */
.portal-header {
    padding: 16px 24px 8px;
    text-align: center;
}

.portal-header h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.portal-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Form Styling - Compact */
.portal-form {
    padding: 16px 24px 20px;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.input-icon {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text-primary);
    background: #f8fafc;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    outline: none;
}

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

.form-group input:focus {
    border-color: var(--border-focus);
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input.error {
    border-color: var(--error);
    background: #fef2f2;
}

.error-message {
    display: block;
    color: var(--error);
    font-size: 11px;
    font-weight: 500;
    margin-top: 4px;
    min-height: 16px;
}

/* Captcha Styles - Compact */
.captcha-group {
    margin-bottom: 16px;
}

.captcha-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    background: #f1f5f9;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
}

.captcha-question {
    flex: 1;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'SF Mono', 'Consolas', monospace;
    letter-spacing: 2px;
}

.refresh-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.refresh-btn:hover {
    background: var(--primary-dark);
    transform: rotate(90deg);
}

.refresh-btn.loading {
    animation: spin 0.8s linear infinite;
}

.refresh-btn svg {
    pointer-events: none;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 14px 20px;
    margin-top: 6px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px -4px rgba(99, 102, 241, 0.5);
}

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

.btn-arrow {
    transition: transform 0.2s ease;
}

.submit-btn:hover .btn-arrow {
    transform: translateX(3px);
}

.loader {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.hidden {
    display: none !important;
}

/* Form Messages */
.form-message {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    text-align: center;
}

.form-message.success {
    background: var(--success-bg);
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.form-message.error {
    background: var(--error-bg);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Footer - Compact */
.portal-footer {
    background: #fafbfc;
    padding: 14px 24px 16px;
    text-align: center;
    border-top: 1px solid var(--border);
}

.footer-divider {
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 1px;
    margin: 0 auto 10px;
}

.portal-footer p {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.portal-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.portal-footer a:hover {
    text-decoration: underline;
}

.powered-by {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.powered-by strong {
    color: var(--text-secondary);
    font-weight: 700;
}

/* =====================================================
   Responsive Design
   ===================================================== */

@media (max-width: 768px) {
    body {
        padding: 12px;
        align-items: flex-start;
        padding-top: 24px;
    }
    
    .container {
        max-width: 100%;
    }
    
    .logo-section {
        padding: 20px 16px 14px;
    }
    
    .logo {
        max-width: 120px;
    }
    
    .portal-header {
        padding: 14px 20px 6px;
    }
    
    .portal-header h1 {
        font-size: 18px;
    }
    
    .portal-form {
        padding: 14px 20px 18px;
    }
    
    .portal-footer {
        padding: 12px 20px 14px;
    }
    
    .form-group input {
        font-size: 16px; /* Prevents auto-zoom on iOS */
    }
}

@media (max-width: 380px) {
    .portal-header h1 {
        font-size: 17px;
    }
    
    .captcha-question {
        font-size: 16px;
    }
}

/* Prevent zoom on input focus for iOS */
@supports (-webkit-touch-callout: none) {
    .form-group input {
        font-size: 16px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .portal-card {
        animation: none;
    }
    
    .refresh-btn:hover {
        transform: none;
    }
}
