* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #115879 0%, #0a3d54 50%, #115879 100%);
    overflow-x: hidden;
    position: relative;
    padding: 2rem 1rem;
}

.background-animation {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
    overflow: hidden;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(252, 212, 10, 0.15) 0%, transparent 70%);
    animation: float-around 25s infinite ease-in-out;
}

.shape-1 { width: 320px; height: 320px; top: -120px; left: -120px; animation-delay: 0s; }
.shape-2 { width: 220px; height: 220px; top: 40%; right: -70px; animation-delay: 5s; }
.shape-3 { width: 280px; height: 280px; bottom: -100px; left: 25%; animation-delay: 10s; }
.shape-4 { width: 190px; height: 190px; top: 15%; right: 25%; animation-delay: 15s; }
.shape-5 { width: 240px; height: 240px; bottom: 25%; right: -80px; animation-delay: 20s; }
.shape-6 { width: 160px; height: 160px; top: 60%; left: 10%; animation-delay: 12s; }

@keyframes float-around {
    0%, 100% { transform: translate(0,0) scale(1) rotate(0deg); opacity: 0.3; }
    25% { transform: translate(60px,-60px) scale(1.15) rotate(90deg); opacity: 0.5; }
    50% { transform: translate(-40px,60px) scale(0.85) rotate(180deg); opacity: 0.4; }
    75% { transform: translate(50px,40px) scale(1.08) rotate(270deg); opacity: 0.6; }
}

.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 550px;
}

.card-3d { perspective: 1500px; }

.card-inner {
    width: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-face {
    position: relative;
    backface-visibility: hidden;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    padding: 2.5rem 2.5rem;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3), 0 0 100px rgba(252,212,10,0.1);
}

.card-front { animation: card-entrance 1s ease-out; }

@keyframes card-entrance {
    0% { transform: rotateY(-180deg) scale(0.8); opacity: 0; }
    100% { transform: rotateY(0) scale(1); opacity: 1; }
}

.brand-header { text-align: center; margin-bottom: 2rem; }

.logo-circle {
    width: 90px;
    height: 90px;
    margin: 0 auto 1.2rem;
    background: linear-gradient(135deg, #fcd40a 0%, #e6c009 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(252,212,10,0.4);
    position: relative;
    animation: logo-pulse 2s ease-in-out infinite;
}

@keyframes logo-pulse {
    0%,100% { transform: scale(1); box-shadow: 0 10px 30px rgba(252,212,10,0.4); }
    50% { transform: scale(1.05); box-shadow: 0 15px 40px rgba(252,212,10,0.6); }
}

.logo-text {
    font-size: 2rem;
    font-weight: 700;
    color: #115879;
    position: relative;
    z-index: 2;
}

.logo-rings { position: absolute; width: 100%; height: 100%; top: 0; left: 0; }

.ring {
    position: absolute;
    border: 2px solid rgba(17, 88, 121, 0.2);
    border-radius: 50%;
    animation: ring-pulse 3s ease-out infinite;
}

.ring-1 { width: 110%; height: 110%; top: -5%; left: -5%; animation-delay: 0s; }
.ring-2 { width: 130%; height: 130%; top: -15%; left: -15%; animation-delay: 0.5s; }

@keyframes ring-pulse {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.3); opacity: 0; }
}

.brand-header h1 { font-size: 1.8rem; color: #115879; margin-bottom: 0.4rem; }
.brand-header .highlight { color: #fcd40a; text-shadow: 2px 2px 4px rgba(252,212,10,0.3); }
.tagline { color: #666; font-size: 0.9rem; }

/* User Type Toggle */
.user-type-toggle {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1.8rem;
    background: #f5f5f5;
    padding: 0.4rem;
    border-radius: 50px;
}

.type-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.2rem;
    background: transparent;
    border: none;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.type-btn svg {
    transition: all 0.3s ease;
}

.type-btn.active {
    background: linear-gradient(135deg, #fcd40a 0%, #e6c009 100%);
    color: #115879;
    box-shadow: 0 4px 15px rgba(252,212,10,0.3);
}

.type-btn:hover:not(.active) {
    color: #115879;
    background: rgba(17, 88, 121, 0.05);
}

.form-creative { display: flex; flex-direction: column; gap: 1.3rem; }

.name-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
[dir="rtl"] .name-row { grid-template-columns: 1fr 1fr; }

.input-creative { position: relative; }

.input-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #115879;
    transition: all 0.3s ease;
    z-index: 1;
}
[dir="ltr"] .input-icon { left: 0; }
[dir="rtl"] .input-icon { right: 0; left: auto; }

.input-creative input,
.input-creative select {
    width: 100%;
    padding: 0.9rem 0.9rem 0.9rem 2.3rem;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    color: #115879;
    outline: none;
    transition: all 0.3s ease;
}

[dir="rtl"] .input-creative input,
[dir="rtl"] .input-creative select {
    padding: 0.9rem 2.3rem 0.9rem 0.9rem;
    text-align: right;
}

.input-creative input::placeholder { color: #999; }

/* Select styling */
select {
    cursor: pointer;
    appearance: none;
}

select option {
    background: white;
    color: #115879;
}

.input-creative:has(select)::after {
    content: '▼';
    position: absolute;
    right: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: #115879;
    font-size: 0.7rem;
    pointer-events: none;
}

[dir="rtl"] .input-creative:has(select)::after {
    right: auto;
    left: 0.9rem;
}

.input-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #e0e0e0;
    transition: all 0.3s ease;
}
.input-line::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #fcd40a 0%, #115879 100%);
    transition: width 0.4s ease;
}
.input-creative input:focus ~ .input-line::after,
.input-creative select:focus ~ .input-line::after { width: 100%; }
.input-creative input:focus ~ .input-icon,
.input-creative select:focus ~ .input-icon {
    color: #fcd40a;
    transform: translateY(-50%) scale(1.1);
}

.password-strength {
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 3px;
    background: #f0f0f0;
    border-radius: 2px;
    overflow: hidden;
}
.strength-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #ff4444, #ffaa44, #fcd40a);
    transition: width 0.3s ease;
}

/* Show/hide fields based on user type */
.teacher-fields,
.student-fields {
    display: flex;
    flex-direction: column;
    gap: 1.3rem;
}

.terms-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 0.8rem;
    color: #666;
    line-height: 1.4;
    margin-top: 0.3rem;
}
[dir="rtl"] .terms-label { flex-direction: row-reverse; text-align: right; }

.terms-label input[type="checkbox"] { display: none; }

.custom-checkbox {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 2px solid #115879;
    border-radius: 5px;
    margin-right: 0.6rem;
    margin-top: 2px;
    position: relative;
    transition: all 0.3s ease;
}
[dir="rtl"] .custom-checkbox { margin-right: 0; margin-left: 0.6rem; }

.terms-label input:checked ~ .custom-checkbox {
    background: linear-gradient(135deg, #fcd40a 0%, #e6c009 100%);
    border-color: #fcd40a;
}
.custom-checkbox::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%) scale(0);
    color: #115879;
    font-weight: bold;
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}
.terms-label input:checked ~ .custom-checkbox::after {
    transform: translate(-50%,-50%) scale(1);
}

.terms-text a {
    color: #115879;
    text-decoration: none;
    font-weight: 500;
}
.terms-text a:hover { color: #fcd40a; }

.btn-gradient {
    position: relative;
    padding: 1rem;
    background: linear-gradient(135deg, #fcd40a 0%, #e6c009 100%);
    border: none;
    border-radius: 50px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #115879;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
    width: 100%;
}
.btn-gradient span { position: relative; z-index: 1; }
.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s ease;
}
.btn-gradient:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(252,212,10,0.4);
}
.btn-gradient:hover .btn-shine { left: 100%; }

.btn-particles { position: absolute; width: 100%; height: 100%; top: 0; left: 0; pointer-events: none; }
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255,255,255,0.6);
    border-radius: 50%;
    animation: particle-float 3s infinite ease-in-out;
}
.particle:nth-child(1) { left: 20%; animation-delay: 0s; }
.particle:nth-child(2) { left: 50%; animation-delay: 1s; }
.particle:nth-child(3) { left: 80%; animation-delay: 2s; }

@keyframes particle-float {
    0%, 100% { transform: translateY(0) scale(0); opacity: 0; }
    50% { transform: translateY(-20px) scale(1); opacity: 1; }
}

.divider-creative {
    text-align: center;
    position: relative;
    margin: 1.2rem 0;
}
.divider-creative span {
    background: rgba(255,255,255,0.98);
    padding: 0 1rem;
    color: #999;
    font-size: 0.82rem;
    position: relative;
    z-index: 1;
}
.divider-creative::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e0e0e0, transparent);
}

.social-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}
.btn-social {
    width: 50px;
    height: 50px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}
.btn-social:hover {
    border-color: #fcd40a;
    transform: translateY(-3px) rotate(5deg);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.login-text {
    text-align: center;
    margin-top: 1.2rem;
    color: #666;
    font-size: 0.9rem;
}
.login-link {
    color: #115879;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}
.login-link:hover { color: #fcd40a; }

.lang-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    backdrop-filter: blur(10px);
    z-index: 10;
}
[dir="rtl"] .lang-toggle {
    right: auto;
    left: 20px;
}

@media (max-width: 576px) {
    body { padding: 1rem; }
    .card-face { padding: 2rem 1.5rem; }
    .brand-header h1 { font-size: 1.5rem; }
    .logo-circle { width: 75px; height: 75px; }
    .logo-text { font-size: 1.6rem; }
    .name-row { grid-template-columns: 1fr; }
    .form-creative { gap: 1.2rem; }
    .user-type-toggle { gap: 0.5rem; }
    .type-btn { padding: 0.6rem 0.8rem; font-size: 0.85rem; }
}