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

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --secondary: #2563eb;
    --accent: #3b82f6;
    --bg-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #60a5fa 100%);
    --bg-dark: #0f172a;
    --bg-card: rgba(255, 255, 255, 0.95);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: rgba(59, 130, 246, 0.2);
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 25px 80px rgba(0, 0, 0, 0.4);
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
    position: relative;
}

/* Particle Canvas */
#particles-canvas,
#background-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* Language Selection Screen */
.language-selection {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    background: var(--bg-dark);
    animation: fadeIn 0.6s ease-out;
}

.language-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 40px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    max-width: 500px;
    width: 90%;
    animation: slideUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.language-logo {
    width: 100px;
    height: 100px;
    margin: 0 auto 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-gradient);
    border-radius: 50%;
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.4);
    animation: float 3s ease-in-out infinite;
}

.language-logo i {
    font-size: 3rem;
    color: white;
}

.language-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--bg-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.language-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 40px;
    font-weight: 400;
}

.language-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.language-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 32px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.language-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--bg-gradient);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
    z-index: 0;
}

.language-btn:hover::before {
    width: 600px;
    height: 600px;
}

.language-btn:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(59, 130, 246, 0.35);
}

.language-btn:active {
    transform: translateY(-1px);
}

.language-btn .fi,
.language-btn span {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.language-btn .fi {
    font-size: 1.5rem;
    width: 1.5rem;
    height: 1.125rem;
    display: inline-block;
    border-radius: 2px;
    transition: transform 0.3s ease;
}

.language-btn:hover .fi {
    transform: scale(1.2);
}

.language-btn:hover span {
    color: white;
}

/* Main App */
.main-app {
    position: relative;
    min-height: 100vh;
    z-index: 2;
}

/* Loader */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.6s ease-out;
}

.loader-content {
    text-align: center;
    position: relative;
}

.loader-logo {
    width: 100px;
    height: 100px;
    margin: 0 auto 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-gradient);
    border-radius: 50%;
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.4);
    animation: rotate 2s linear infinite;
}

.loader-logo i {
    font-size: 3rem;
    color: white;
}

.loader-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    z-index: -1;
}

.loader-content h2 {
    color: white;
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.loader-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.loader-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-light);
    animation: bounce 1.4s infinite ease-in-out;
}

.loader-dots span:nth-child(1) { animation-delay: -0.32s; }
.loader-dots span:nth-child(2) { animation-delay: -0.16s; }

/* Container */
.container {
    max-width: 500px;
    margin: 60px auto;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 40px;
    border: 1px solid var(--border-color);
    animation: fadeInUp 1s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 2;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 32px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.logo {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
    border: 3px solid var(--primary-light);
    background: white;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05) rotate(5deg);
}

.language-switcher {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 2px solid rgba(59, 130, 246, 0.2);
    background: white;
    color: #3b82f6;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.language-switcher:hover {
    background: #3b82f6;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    border-color: #3b82f6;
}

header h1 {
    font-size: 2rem;
    font-weight: 800;
    background: var(--bg-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 12px 0;
    letter-spacing: -0.5px;
}

header p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

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

.apply-form label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.apply-form label i {
    color: var(--primary);
    margin-right: 8px;
}

.apply-form input,
.apply-form textarea,
.apply-form select {
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
    color: var(--text-primary);
    transition: all 0.3s ease;
    outline: none;
    resize: vertical;
}

.apply-form input:focus,
.apply-form textarea:focus,
.apply-form select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.apply-form button {
    background: var(--bg-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 0;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.apply-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.5);
}

.apply-form button:active {
    transform: translateY(0);
}

/* Radio Group */
.radio-group {
    display: flex;
    gap: 32px;
    margin-top: 12px;
    justify-content: center;
    align-items: center;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: color 0.3s;
}

.radio-group label:hover {
    color: var(--primary);
}

.radio-group input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Role Select */
.role-select-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.role-select-group label {
    font-weight: 600;
    color: var(--text-primary);
}

.role-select {
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.role-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Footer */
footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Toast */
#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    min-width: 280px;
    max-width: 400px;
    background: white;
    color: var(--text-primary);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    padding: 16px 20px;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-left: 4px solid var(--primary);
}

.toast.toast-success {
    border-left-color: #10b981;
}

.toast.toast-error {
    border-left-color: #ef4444;
    color: #ef4444;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

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

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

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

html {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-dark);
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        margin: 20px;
        padding: 24px 20px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .language-content {
        padding: 30px 20px;
    }
    
    .language-title {
        font-size: 2rem;
    }
    
    .language-logo {
        width: 80px;
        height: 80px;
    }
    
    .language-logo i {
        font-size: 2.5rem;
    }
}