/* ============================================
   Godot Leaderboard - Student Registration UI
   ============================================ */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #8b5cf6;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --error: #ef4444;
    --error-light: #fee2e2;
    --dark: #1f2937;
    --gray: #6b7280;
    --gray-light: #f3f4f6;
    --border: #e5e7eb;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--dark);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

/* ============================================
   Header
   ============================================ */

.header {
    background: white;
    border-radius: 12px;
    padding: 40px 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--gray);
    font-size: 1.1rem;
}

/* ============================================
   Main Content
   ============================================ */

.main {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Messages */
#messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    padding: 15px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

.message.success {
    background: var(--success-light);
    color: #065f46;
    border-left: 4px solid var(--success);
}

.message.error {
    background: var(--error-light);
    color: #7f1d1d;
    border-left: 4px solid var(--error);
}

.message.warning {
    background: var(--warning-light);
    color: #78350f;
    border-left: 4px solid var(--warning);
}

.message.info {
    background: #dbeafe;
    color: #0c2d6b;
    border-left: 4px solid #3b82f6;
}

@keyframes slideIn {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Alert Boxes */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    border-left: 4px solid;
}

.alert-info {
    background: #dbeafe;
    color: #0c2d6b;
    border-left-color: #3b82f6;
}

.alert-warning {
    background: var(--warning-light);
    color: #78350f;
    border-left-color: var(--warning);
}

/* ============================================
   Registration Section
   ============================================ */

.registration-section {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: var(--shadow);
}

.registration-section h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--dark);
}

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

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

.form-group label {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.95rem;
}

.form-group input {
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
    font-family: inherit;
}

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

.form-group input:invalid {
    border-color: var(--error);
}

.form-group small {
    color: var(--gray);
    font-size: 0.85rem;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

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

.btn-secondary {
    background: var(--gray-light);
    color: var(--dark);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
    transform: translateY(-2px);
}

/* Loading State */
#loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 40px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--gray-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ============================================
   Success Section
   ============================================ */

.success-section {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: var(--shadow);
}

.success-card {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.success-card h2 {
    color: var(--success);
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.credential-box {
    background: var(--gray-light);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.credential-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.credential-item label {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.credential-value {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.credential-value code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.95rem;
    word-break: break-all;
    flex: 1;
    color: var(--dark);
}

.copy-btn {
    padding: 6px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: var(--primary-dark);
}

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

/* Warning Box */
.warning-box {
    background: var(--warning-light);
    border: 1px solid var(--warning);
    border-radius: 8px;
    padding: 20px;
    color: #78350f;
}

.warning-box strong {
    color: #92400e;
    display: block;
    margin-bottom: 10px;
}

.warning-box ul {
    list-style: none;
    padding-left: 20px;
}

.warning-box li {
    margin: 8px 0;
    position: relative;
    padding-left: 20px;
}

.warning-box li:before {
    content: "→";
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Next Steps */
.next-steps {
    background: #dbeafe;
    border: 1px solid #3b82f6;
    border-radius: 8px;
    padding: 20px;
    color: #0c2d6b;
}

.next-steps h3 {
    margin-bottom: 12px;
    color: #0c2d6b;
}

.next-steps ol {
    padding-left: 25px;
}

.next-steps li {
    margin: 8px 0;
}

/* ============================================
   Help Section
   ============================================ */

.help-section {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: var(--shadow);
}

.help-section h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: var(--dark);
}

.help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.help-card {
    background: var(--gray-light);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s;
}

.help-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.help-card h3 {
    color: var(--primary);
    font-size: 1.1rem;
}

.help-card p {
    color: var(--gray);
    font-size: 0.95rem;
    line-height: 1.5;
}

.link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.link:hover {
    color: var(--primary-dark);
}

/* ============================================
   Footer
   ============================================ */

.footer {
    text-align: center;
    color: white;
    padding: 20px;
    font-size: 0.9rem;
    margin-top: 40px;
}

.footer a {
    color: white;
    text-decoration: none;
    font-weight: 600;
}

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

/* ============================================
   Utility Classes
   ============================================ */

.hidden {
    display: none !important;
}

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

@media (max-width: 768px) {
    .header {
        padding: 30px 20px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .registration-section,
    .success-section,
    .help-section {
        padding: 25px;
    }

    .help-grid {
        grid-template-columns: 1fr;
    }

    .credential-value {
        flex-direction: column;
        align-items: flex-start;
    }

    .copy-btn {
        width: 100%;
    }
}