/* ============================================
   QIMA Forms - Creative Design
   ============================================ */

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

:root {
    --primary: #C8540A;
    --primary-dark: #A84608;
    --secondary: #E8860A;
    --accent: #F5A623;
    --bg-dark: #0F0E17;
    --bg-card: #1A1930;
    --bg-card-hover: #232145;
    --text-primary: #FFFFFE;
    --text-secondary: #A7A9BE;
    --text-muted: #72738B;
    --border: rgba(200, 84, 10, 0.2);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 40px rgba(200, 84, 10, 0.15);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============ HOME PAGE ============ */

.home-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
}

.home-container {
    text-align: center;
    z-index: 2;
    padding: 40px 20px;
}

.logo-section {
    margin-bottom: 60px;
}

.logo-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    animation: float 3s ease-in-out infinite;
}

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

.logo-title {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 6px;
    margin-bottom: 8px;
}

.logo-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 2px;
}

.buttons-grid {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
}

.form-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px 48px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    cursor: pointer;
    min-width: 220px;
}

.form-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    transform: translateY(-6px);
    box-shadow: var(--shadow-glow);
}

.form-card .card-icon {
    width: 56px;
    height: 56px;
    color: var(--primary);
    transition: var(--transition);
}

.form-card:hover .card-icon {
    color: var(--accent);
    transform: scale(1.1);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.card-arrow {
    font-size: 1.4rem;
    opacity: 0;
    transform: translateX(-10px);
    transition: var(--transition);
}

.form-card:hover .card-arrow {
    opacity: 1;
    transform: translateX(0);
}

.form-card.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Background shapes */
.bg-shapes {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.08;
}

.shape-1 {
    width: 500px;
    height: 500px;
    background: var(--primary);
    top: -150px;
    right: -100px;
    animation: drift 20s ease-in-out infinite;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: var(--secondary);
    bottom: -100px;
    left: -100px;
    animation: drift 25s ease-in-out infinite reverse;
}

.shape-3 {
    width: 300px;
    height: 300px;
    background: var(--accent);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes drift {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(30px, -30px); }
    66% { transform: translate(-20px, 20px); }
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.05; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.1; }
}

/* ============ FORM PAGE ============ */

.form-page {
    background: var(--bg-dark);
    min-height: 100vh;
    padding: 40px 20px 80px;
}

.form-wrapper {
    max-width: 780px;
    margin: 0 auto;
}

/* Form Header */
.form-header {
    text-align: center;
    margin-bottom: 48px;
    position: relative;
}

.form-header .back-link {
    position: absolute;
    left: 0;
    top: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.form-header .back-link:hover {
    color: var(--primary);
}

.form-header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

.form-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Progress Bar */
.progress-bar {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 48px;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.progress-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition);
    background: var(--bg-card);
}

.progress-step.active .progress-dot {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
    box-shadow: 0 0 20px rgba(200, 84, 10, 0.4);
}

.progress-step.completed .progress-dot {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
}

.progress-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: none;
}

.progress-step.active .progress-label {
    display: block;
    color: var(--text-primary);
}

.progress-line {
    width: 40px;
    height: 2px;
    background: var(--border);
    align-self: center;
    border-radius: 2px;
    transition: var(--transition);
}

.progress-line.completed {
    background: var(--accent);
}

/* Form Sections */
.form-section {
    display: none;
    animation: fadeIn 0.4s ease;
}

.form-section.active {
    display: block;
}

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

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.section-letter {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.section-title h2 {
    font-size: 1.3rem;
    font-weight: 600;
}

.section-title h2 small {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Form Groups */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-group label .required {
    color: #EF4444;
    margin-left: 2px;
}

.form-group label .hint {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 3px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    transition: var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(200, 84, 10, 0.15);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group select {
    cursor: pointer;
    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='%23A7A9BE' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* Checkbox / Radio Groups */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.checkbox-item,
.radio-item {
    position: relative;
}

.checkbox-item input,
.radio-item input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-item label,
.radio-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
    font-weight: 400;
    margin-bottom: 0;
}

.checkbox-item label:hover,
.radio-item label:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
}

.checkbox-item input:checked + label,
.radio-item input:checked + label {
    border-color: var(--primary);
    background: rgba(200, 84, 10, 0.1);
    color: var(--text-primary);
}

.check-mark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-muted);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.radio-item .check-mark {
    border-radius: 50%;
}

.checkbox-item input:checked + label .check-mark,
.radio-item input:checked + label .check-mark {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-item input:checked + label .check-mark::after,
.radio-item input:checked + label .check-mark::after {
    content: '';
    display: block;
}

.checkbox-item input:checked + label .check-mark::after {
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translateY(-1px);
}

.radio-item input:checked + label .check-mark::after {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.radio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

/* Navigation Buttons */
.form-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

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

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(200, 84, 10, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(200, 84, 10, 0.4);
}

.btn-submit {
    background: linear-gradient(135deg, var(--accent), #D4740A);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 166, 35, 0.3);
    padding: 14px 40px;
    font-size: 1rem;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(245, 166, 35, 0.4);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

/* Success Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    animation: modalIn 0.4s ease;
}

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

.modal-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #D4740A);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2rem;
    color: white;
}

.modal-content h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.modal-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

/* Error styling */
.form-group.error input,
.form-group.error textarea,
.form-group.error select {
    border-color: #EF4444;
}

.error-msg {
    color: #EF4444;
    font-size: 0.75rem;
    margin-top: 4px;
    display: none;
}

.form-group.error .error-msg {
    display: block;
}

/* Info box */
.info-box {
    background: rgba(200, 84, 10, 0.08);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin-bottom: 32px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    .checkbox-grid,
    .radio-grid {
        grid-template-columns: 1fr;
    }
    .logo-title {
        font-size: 2.5rem;
    }
    .buttons-grid {
        flex-direction: column;
        align-items: center;
    }
    .form-card {
        width: 100%;
        max-width: 280px;
    }
    .progress-label {
        display: none !important;
    }
    .form-nav {
        flex-direction: column;
        gap: 12px;
    }
    .form-nav .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: none;
}

.btn.loading .spinner {
    display: block;
}

.btn.loading span {
    display: none;
}

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