/* ===== RAYA CORE WARRANTY - Main Styles ===== */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

:root {
    --rcw-primary: #2563eb;
    --rcw-primary-dark: #1d4ed8;
    --rcw-primary-light: rgba(37, 99, 235, 0.12);
    --rcw-success: #10b981;
    --rcw-success-dark: #059669;
    --rcw-error: #ef4444;
    --rcw-error-dark: #dc2626;
    --rcw-bg: #ffffff;
    --rcw-bg-card: #ffffff;
    --rcw-bg-secondary: #f8fafc;
    --rcw-border: #e2e8f0;
    --rcw-text: #1e293b;
    --rcw-text-secondary: #64748b;
    --rcw-text-muted: #94a3b8;
    --rcw-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    --rcw-radius: 12px;
    --rcw-radius-lg: 20px;
    --rcw-transition: 0.25s ease;
}

.rcw-wrapper {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    max-width: 520px;
    margin: 0 auto;
    padding: 20px 15px;
    direction: rtl;
    color: var(--rcw-text);
}

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* Header */
.rcw-header {
    text-align: center;
    margin-bottom: 28px;
}

.rcw-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 6px;
}

.rcw-logo-icon {
    font-size: 32px;
    color: var(--rcw-primary);
    animation: rcw-spin-slow 8s linear infinite;
}

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

.rcw-logo h2 {
    font-size: 26px;
    font-weight: 800;
    color: var(--rcw-text);
    margin: 0;
    letter-spacing: 1px;
}

.rcw-logo h2 span {
    color: var(--rcw-primary);
}

.rcw-subtitle {
    color: var(--rcw-text-secondary);
    font-size: 14px;
    font-weight: 400;
    margin: 0;
}

/* Card */
.rcw-card {
    background: var(--rcw-bg-card);
    border: 1px solid var(--rcw-border);
    border-radius: var(--rcw-radius-lg);
    padding: 35px 28px 28px;
    box-shadow: var(--rcw-shadow);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.rcw-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 20%, rgba(37, 99, 235, 0.03) 0%, transparent 60%);
    pointer-events: none;
}

.rcw-card-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--rcw-primary), var(--rcw-primary-dark));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.rcw-card-icon svg {
    width: 30px;
    height: 30px;
    color: #fff;
}

.rcw-card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--rcw-text);
    margin: 0 0 6px;
}

.rcw-card-desc {
    font-size: 13px;
    color: var(--rcw-text-muted);
    margin: 0 0 24px;
    line-height: 1.6;
}

/* Form */
.rcw-form {
    position: relative;
    z-index: 1;
}

.rcw-input-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

#rcw_serial {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid var(--rcw-border);
    border-radius: var(--rcw-radius);
    font-size: 15px;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    direction: rtl;
    background: var(--rcw-bg);
    transition: all var(--rcw-transition);
    color: var(--rcw-text);
    outline: none;
}

#rcw_serial::placeholder {
    color: var(--rcw-text-muted);
    font-weight: 400;
}

#rcw_serial:focus {
    border-color: var(--rcw-primary);
    box-shadow: 0 0 0 3px var(--rcw-primary-light);
}

#rcw_serial.error {
    border-color: var(--rcw-error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.rcw-validation-msg {
    font-size: 12px;
    color: var(--rcw-error);
    margin-top: 8px;
    text-align: right;
}

.rcw-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--rcw-primary), var(--rcw-primary-dark));
    color: #fff;
    border: none;
    border-radius: var(--rcw-radius);
    font-size: 15px;
    font-weight: 600;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    cursor: pointer;
    transition: all var(--rcw-transition);
    white-space: nowrap;
}

.rcw-btn:hover {
    background: linear-gradient(135deg, var(--rcw-primary-dark), #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}

.rcw-btn:active {
    transform: translateY(0);
}

.rcw-btn:focus-visible {
    outline: 2px solid var(--rcw-primary);
    outline-offset: 2px;
}

.rcw-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.rcw-btn-arrow {
    width: 18px;
    height: 18px;
    transition: transform var(--rcw-transition);
}

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

/* Loading */
.rcw-loading {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--rcw-text-secondary);
    font-size: 14px;
}

.rcw-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--rcw-border);
    border-top-color: var(--rcw-primary);
    border-radius: 50%;
    animation: rcw-spin 0.7s linear infinite;
}

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

/* Footer */
.rcw-footer {
    text-align: center;
    margin-top: 18px;
}

.rcw-footer p {
    font-size: 12px;
    color: var(--rcw-text-muted);
    margin: 0;
}

/* Modal */
.rcw-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: none;
    direction: rtl;
}

.rcw-modal-box {
    background: var(--rcw-bg-card);
    width: 92%;
    max-width: 420px;
    margin: 12vh auto;
    padding: 32px 28px 28px;
    border-radius: var(--rcw-radius-lg);
    position: relative;
    animation: rcw-pop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-height: 80vh;
    overflow-y: auto;
}

@keyframes rcw-pop {
    from {
        transform: scale(0.85) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.rcw-close-btn {
    position: absolute;
    top: 12px;
    left: 16px;
    background: #f1f5f9;
    border: none;
    font-size: 22px;
    color: var(--rcw-text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-family: inherit;
    line-height: 1;
}

.rcw-close-btn:hover {
    background: var(--rcw-border);
    color: var(--rcw-text);
}

.rcw-close-btn:focus-visible {
    outline: 2px solid var(--rcw-primary);
    outline-offset: 2px;
}

/* Result */
.rcw-result-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: bold;
    color: #fff;
}

.rcw-result-icon.rcw-success {
    background: linear-gradient(135deg, var(--rcw-success), var(--rcw-success-dark));
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.rcw-result-icon.rcw-error {
    background: linear-gradient(135deg, var(--rcw-error), var(--rcw-error-dark));
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.rcw-result-title {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--rcw-text);
    margin: 0 0 16px;
}

.rcw-result-msg {
    text-align: center;
    color: var(--rcw-text-secondary);
    font-size: 14px;
    margin: 0 0 4px;
}

.rcw-result-hint {
    text-align: center;
    color: var(--rcw-text-muted);
    font-size: 13px;
    margin: 0;
}

.rcw-result-details {
    background: var(--rcw-bg-secondary);
    border-radius: 14px;
    padding: 6px 0;
    border: 1px solid var(--rcw-border);
}

.rcw-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--rcw-border);
}

.rcw-result-row:last-child {
    border-bottom: none;
}

.rcw-result-label {
    color: var(--rcw-text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.rcw-result-value {
    color: var(--rcw-text);
    font-size: 14px;
    font-weight: 600;
}

.rcw-status-row {
    background: rgba(37, 99, 235, 0.03);
    border-radius: 0 0 14px 14px;
    margin-top: 4px;
}

.rcw-result-status {
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}

.rcw-status-active {
    background: rgba(16, 185, 129, 0.12);
    color: var(--rcw-success-dark);
}

.rcw-status-expired {
    background: rgba(239, 68, 68, 0.12);
    color: var(--rcw-error-dark);
}

/* Autocomplete */
.rcw-autocomplete-list {
    position: absolute;
    z-index: 1000;
    background: var(--rcw-bg);
    border: 1px solid var(--rcw-border);
    border-radius: var(--rcw-radius);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    max-height: 200px;
    overflow-y: auto;
    direction: rtl;
}

.rcw-autocomplete-list[role="listbox"] {
    display: none;
}

.rcw-autocomplete-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    color: var(--rcw-text);
    transition: background 0.15s ease;
    border-bottom: 1px solid var(--rcw-border);
}

.rcw-autocomplete-item:last-child {
    border-bottom: none;
}

.rcw-autocomplete-item:hover,
.rcw-autocomplete-item.active {
    background: var(--rcw-primary-light);
}

/* Dark mode toggle button */
.rcw-dark-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--rcw-bg-card);
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--rcw-transition);
    color: var(--rcw-text);
}

.rcw-dark-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

/* Responsive */
@media (max-width: 480px) {
    .rcw-input-group {
        flex-direction: column;
    }

    .rcw-btn {
        justify-content: center;
    }

    .rcw-card {
        padding: 24px 18px 20px;
    }

    .rcw-modal-box {
        padding: 24px 18px 20px;
        margin: 8vh auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rcw-logo-icon,
    .rcw-spinner,
    .rcw-modal-box,
    .rcw-btn-arrow,
    .rcw-btn {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
