/* CSS Variables - Dark Mode (Default) */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --success: #10b981;
    --error: #ef4444;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: rgba(30, 41, 59, 0.95);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: rgba(148, 163, 184, 0.15);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --radius: 8px;
    --radius-lg: 14px;
}

/* Light Mode */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #e2e8f0;
    --bg-tertiary: #cbd5e1;
    --bg-card: rgba(255, 255, 255, 0.95);
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --border: rgba(51, 65, 85, 0.15);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] body::before {
    background:
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(168, 85, 247, 0.05) 0%, transparent 50%);
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Base */
html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Montserrat', 'Poppins', 'Roboto', system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.4;
}

/* RTL Support */
[dir="rtl"] {
    font-family: 'Cairo', 'Tajawal', system-ui, sans-serif;
}

[dir="rtl"] .form-group select {
    background-position: left 10px center;
    padding-right: 12px;
    padding-left: 32px;
}

[dir="rtl"] .form-section h3::before {
    order: 1;
}

[dir="rtl"] .form-actions {
    flex-direction: row-reverse;
}

[dir="rtl"] .result-actions {
    flex-direction: row-reverse;
}

[dir="rtl"] .modal-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .modal-footer {
    flex-direction: row-reverse;
}

[dir="rtl"] .success-close {
    right: auto;
    left: 16px;
}

[dir="rtl"] .credential-card {
    flex-direction: row-reverse;
}

[dir="rtl"] .credential-info {
    text-align: right;
}

[dir="rtl"] .success-actions {
    flex-direction: row-reverse;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(168, 85, 247, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* Container */
.container {
    height: 100vh;
    max-width: 1000px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    padding: 8px 0 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
}

.header-right {
    justify-content: flex-end;
}

[dir="rtl"] .header-left {
    order: 3;
}

[dir="rtl"] .header-right {
    order: 1;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-container {
    background: var(--bg-card);
    padding: 8px 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.logo p {
    color: var(--text-secondary);
    font-size: 0.7rem;
    margin-top: 2px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* Language Toggle */
.lang-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

/* Theme Toggle */
.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.theme-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.theme-toggle .icon-sun {
    display: none;
}

.theme-toggle .icon-moon {
    display: block;
}

[data-theme="light"] .theme-toggle .icon-sun {
    display: block;
}

[data-theme="light"] .theme-toggle .icon-moon {
    display: none;
}

.lang-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.lang-btn.active {
    background: var(--primary);
    color: white;
}

.lang-btn:hover:not(.active) {
    color: var(--text-primary);
}

/* Main */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Card */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.card-header {
    padding: 14px 20px;
    background: var(--primary-gradient);
}

.card-header h2 {
    font-size: 1rem;
    font-weight: 600;
}

.card-header.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

/* Form */
.form {
    padding: 16px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

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

.form-section h3 {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--primary-light);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-section h3::before {
    content: '';
    width: 3px;
    height: 12px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

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

.form-group label {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.form-group input,
.form-group select {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.8rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.2s;
    width: 100%;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

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

/* Searchable Select */
.searchable-select {
    position: relative;
}

.searchable-input {
    width: 100%;
    cursor: text;
}

.searchable-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--primary);
    border-top: none;
    border-radius: 0 0 6px 6px;
    z-index: 100;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.searchable-dropdown.show {
    display: block;
}

.searchable-option {
    padding: 8px 10px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-primary);
    transition: background 0.15s;
}

.searchable-option:hover,
.searchable-option.highlighted {
    background: var(--primary);
    color: white;
}

.searchable-option.no-results {
    color: var(--text-muted);
    font-style: italic;
    cursor: default;
}

.searchable-option.no-results:hover {
    background: transparent;
    color: var(--text-muted);
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

/* Buttons */
.btn {
    padding: 9px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-primary:disabled {
    background: var(--bg-tertiary);
    box-shadow: none;
    transform: none;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* Confirm Modal */
.confirm-modal {
    max-width: 400px;
}

.confirm-modal .modal-body p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.modal-header.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Success Modal */
.success-modal {
    max-width: 480px;
    text-align: center;
    padding: 0;
    overflow: hidden;
    position: relative;
    border-radius: 20px;
    background: var(--bg-card);
}

.success-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.success-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Animated Background */
.success-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 160px;
    background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
    overflow: hidden;
}

.success-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 3s ease-in-out infinite;
}

.success-circle:nth-child(1) {
    width: 80px;
    height: 80px;
    top: -20px;
    left: 10%;
    animation-delay: 0s;
}

.success-circle:nth-child(2) {
    width: 60px;
    height: 60px;
    top: 40px;
    right: 15%;
    animation-delay: 1s;
}

.success-circle:nth-child(3) {
    width: 40px;
    height: 40px;
    bottom: 20px;
    left: 30%;
    animation-delay: 2s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.5; }
    50% { transform: translateY(-10px) scale(1.1); opacity: 0.8; }
}

/* Success Badge */
.success-badge {
    position: relative;
    z-index: 5;
    margin-top: 100px;
    margin-bottom: -35px;
}

.success-badge-inner {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.4);
    animation: badgePop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 4px solid var(--bg-card);
}

@keyframes badgePop {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.success-badge-inner svg {
    animation: checkDraw 0.4s ease-out 0.3s both;
}

@keyframes checkDraw {
    0% { stroke-dasharray: 100; stroke-dashoffset: 100; }
    100% { stroke-dasharray: 100; stroke-dashoffset: 0; }
}

/* Content */
.success-content {
    padding: 50px 30px 30px;
}

.success-content h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    animation: fadeInUp 0.5s ease 0.2s both;
}

.success-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 28px;
    animation: fadeInUp 0.5s ease 0.3s both;
}

@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Customer Info Bar */
.customer-info-bar {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
    animation: fadeInUp 0.5s ease 0.35s both;
}

.customer-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--bg-secondary);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.2s;
}

.customer-info-item svg {
    color: var(--primary);
    flex-shrink: 0;
}

.customer-info-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

[dir="rtl"] .customer-info-bar {
    flex-direction: row-reverse;
}

[dir="rtl"] .customer-info-item {
    flex-direction: row-reverse;
}

/* Credentials Cards */
.credentials-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    animation: fadeInUp 0.5s ease 0.4s both;
}

.credential-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.credential-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.credential-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.credential-info {
    flex: 1;
    text-align: left;
    min-width: 0;
}

.credential-info label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.credential-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.copy-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--bg-secondary);
}

.copy-btn.copied {
    color: white;
    background: var(--success);
    border-color: var(--success);
}

/* ONU Status */
.onu-status-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg-secondary);
    border-radius: 10px;
    margin-bottom: 24px;
    animation: fadeInUp 0.5s ease 0.5s both;
}

.onu-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.onu-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.onu-status.online {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.onu-status.online::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.onu-status.offline {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.onu-status.offline::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
}

/* Success Actions */
.success-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    animation: fadeInUp 0.5s ease 0.6s both;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

/* Result Card */
.result-card {
    animation: fadeIn 0.3s ease;
}

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

.result-content {
    padding: 16px 20px;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.result-item {
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border);
}

.result-item label {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 3px;
}

.result-item span {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

.result-item span.highlight {
    color: var(--primary-light);
    font-weight: 700;
    font-size: 0.95rem;
}

.result-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* Footer */
.footer {
    text-align: center;
    padding: 8px;
    color: var(--text-muted);
    font-size: 0.65rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 6px;
    box-shadow: var(--shadow);
    opacity: 0;
    transition: all 0.3s;
    z-index: 1000;
    font-size: 0.8rem;
    border: 1px solid var(--border);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: #ef4444;
}

.toast.success {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #10b981;
}

/* Settings Button */
.settings-btn {
    position: fixed;
    bottom: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--text-secondary);
}

[dir="rtl"] .settings-btn {
    right: auto;
    left: 16px;
}

.settings-btn:hover {
    background: var(--primary);
    color: white;
    transform: rotate(45deg);
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 380px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: var(--primary-gradient);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: white;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-body {
    padding: 18px;
}

.modal-body .form-group {
    margin-bottom: 12px;
}

.modal-body .form-group:last-child {
    margin-bottom: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    background: var(--bg-tertiary);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Loader */
.btn-loader {
    animation: pulse 1.2s ease-in-out infinite;
}

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

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

[data-theme="light"] .loading-overlay {
    background: rgba(248, 250, 252, 0.9);
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--bg-tertiary);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

/* Responsive */
@media (max-width: 800px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .result-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .container {
        padding: 10px 12px;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .result-grid {
        grid-template-columns: 1fr;
    }
    .form-actions, .result-actions {
        flex-direction: column;
    }
    .btn {
        width: 100%;
    }
    .header {
        flex-direction: column;
        gap: 10px;
    }
    .header-left, .header-right {
        min-width: auto;
    }
    .logo-img {
        height: 40px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

::selection {
    background: rgba(99, 102, 241, 0.3);
}
