/* ===== Modern Design System ===== */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #a5b4fc;
    --accent: #06b6d4;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --text: #1e293b;
    --text-muted: #64748b;
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.1);
    --success: #10b981;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    --shadow-hover: 0 30px 60px rgba(0, 0, 0, 0.25);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    color: var(--text);
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* Decorative background elements */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ===== Card (Glassmorphism) ===== */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: var(--radius);
    max-width: 480px;
    width: 100%;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transform: translateY(0);
    transition: var(--transition);
    animation: slideUp 0.6s ease-out;
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Typography ===== */
h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 28px;
}

/* ===== Form Elements ===== */
form {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

label {
    display: block;
    margin-top: 18px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    letter-spacing: 0.2px;
}

input,
textarea {
    width: 100%;
    padding: 14px 16px;
    margin-top: 8px;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text);
    background: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
    outline: none;
    resize: vertical;
}

input:focus,
textarea:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

textarea {
    min-height: 120px;
    line-height: 1.5;
}

/* ===== Button ===== */
button {
    margin-top: 28px;
    padding: 16px 32px;
    background: var(--bg-gradient);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    transition: var(--transition);
    z-index: 0;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

button:hover::before {
    left: 0;
}

button:active {
    transform: translateY(0);
}

button span {
    position: relative;
    z-index: 1;
}

/* ===== Error Messages ===== */
.error {
    background: var(--error-bg);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    list-style: none;
    margin-bottom: 8px;
    animation: shake 0.4s ease-in-out;
}

.error li {
    color: var(--error);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error li::before {
    content: '⚠';
    font-size: 1.1rem;
    flex-shrink: 0;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* ===== Success Card ===== */
.success-card {
    text-align: center;
}

.success-card h1 {
    margin-bottom: 12px;
}

/* ===== Success Icon ===== */
.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--success), var(--accent));
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0 auto 20px;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.35);
    animation: scaleIn 0.5s ease-out;
}

.success-icon.rejected {
    background: linear-gradient(135deg, var(--error), #f97316);
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.35);
}

@keyframes scaleIn {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    80% {
        transform: scale(1.15);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== Link ===== */
.link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    padding: 8px 0;
}

.link::before {
    content: '←';
    transition: var(--transition);
}

.link:hover {
    color: var(--primary-dark);
    gap: 12px;
}

.link:hover::before {
    transform: translateX(-4px);
}

/* ===== Responsive ===== */
@media (max-width: 540px) {
    .card {
        padding: 28px 24px;
    }

    h1 {
        font-size: 1.65rem;
    }

    button {
        width: 100%;
    }
}

/* ===== Subtle animations for form elements ===== */
form label,
form input,
form textarea,
form button {
    animation: fadeInUp 0.5s ease-out backwards;
}

form label:nth-child(1),
form input:nth-child(2) { animation-delay: 0.1s; }
form label:nth-child(3),
form input:nth-child(4) { animation-delay: 0.15s; }
form label:nth-child(5),
form textarea:nth-child(6) { animation-delay: 0.2s; }
form button { animation-delay: 0.25s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Selection highlight ===== */
::selection {
    background: rgba(99, 102, 241, 0.25);
    color: var(--text);
}

/* ===== Notification (Real-time) ===== */
.notification {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    animation: fadeInUp 0.3s ease;
}

.notification.hidden {
    display: none;
}

.notification-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    flex-shrink: 0;
}

.notification-text {
    font-size: 0.95rem;
    font-weight: 500;
}

.notification.success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
}

.notification.success .notification-icon {
    background: var(--success);
    color: #fff;
}

.notification.error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
}

.notification.error .notification-icon {
    background: var(--error);
    color: #fff;
}

.notification.info {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--primary);
}

.notification.info .notification-icon {
    background: var(--primary);
    color: #fff;
}

/* ===== Status Indicator (Spinner) ===== */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(99, 102, 241, 0.06);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.status-indicator.hidden {
    display: none;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Submission Details (Success Page) ===== */
.submission-details {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

.submission-details h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.detail-value {
    font-weight: 500;
    color: var(--text);
    text-align: right;
}

.detail-value code {
    background: rgba(99, 102, 241, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--primary);
}

.note {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 16px;
}

.note a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.note a:hover {
    text-decoration: underline;
}

/* ===== Multi-Step Form ===== */
.progress {
    margin-bottom: 28px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-bar span {
    display: block;
    height: 100%;
    width: 0%;
    background: var(--bg-gradient);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
}

.progress-steps .step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
    position: relative;
}

.progress-steps .step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e2e8f0;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    transition: var(--transition);
}

.progress-steps .step-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
}

.progress-steps .step.active .step-num {
    background: var(--bg-gradient);
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
    transform: scale(1.1);
}

.progress-steps .step.active .step-label {
    color: var(--primary);
    font-weight: 600;
}

.progress-steps .step.completed .step-num {
    background: var(--success);
    color: #fff;
}

.progress-steps .step.completed .step-label {
    color: var(--success);
}

/* ===== Form Steps ===== */
.form-step {
    display: none;
    animation: fadeInUp 0.4s ease-out;
}

.form-step.active {
    display: block;
}

.form-step label {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
    margin-top: 0;
    color: var(--text);
}

.step-buttons {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}

.btn-next,
.btn-back,
.btn-submit {
    margin-top: 0;
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-next,
.btn-submit {
    background: var(--bg-gradient);
    color: #fff;
    flex: 1;
}

.btn-next:hover,
.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

.btn-back {
    background: #f1f5f9;
    color: var(--text-muted);
    flex: 0 0 auto;
}

.btn-back:hover {
    background: #e2e8f0;
    color: var(--text);
    transform: translateY(-2px);
}

.btn-next span,
.btn-back span,
.btn-submit span {
    position: relative;
    z-index: 1;
}

/* Invalid input state */
input.invalid {
    border-color: var(--error);
    animation: shake 0.4s ease-in-out;
}

input.invalid:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}

/* Rejection reason shown inside the input box */
input.invalid::placeholder {
    color: var(--error);
    opacity: 0.85;
    font-weight: 500;
}

/* Full-page loader shown until admin approves or rejects */
.loading-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(248, 250, 252, 0.97);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.loading-overlay.hidden {
    display: none;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 24px;
    text-align: center;
}

.loading-spinner {
    width: 72px;
    height: 72px;
    border: 6px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

/* Loading state for step buttons */
button:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

button:disabled:hover {
    transform: none;
    box-shadow: none;
}


/* ===== Rejection Box ===== */
.rejection-box {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    margin-bottom: 20px;
    animation: fadeInUp 0.3s ease;
}

.rejection-box.hidden {
    display: none;
}

.rejection-head {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--error);
    margin-bottom: 8px;
}

.rejection-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--error);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.rejection-reason {
    color: var(--text);
    font-size: 0.95rem;
}
