/* ===================================
   Sign In Page - Ultra Premium Design
   =================================== */

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

/* Page Layout */
.signin-page {
    min-height: 100vh;
    display: flex;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f0f23;
    position: relative;
    overflow: hidden;
}

/* Animated Background */
.signin-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 70%, rgba(6, 182, 212, 0.1) 0%, transparent 40%);
    animation: bgPulse 8s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    0% { opacity: 0.8; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.05); }
}

/* Floating Orbs */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: float 20s infinite;
    pointer-events: none;
}

.orb--1 {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    top: -200px;
    left: -200px;
    opacity: 0.3;
    animation-delay: 0s;
}

.orb--2 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    bottom: -150px;
    right: -150px;
    opacity: 0.25;
    animation-delay: -5s;
}

.orb--3 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #ec4899, #f43f5e);
    top: 50%;
    left: 30%;
    opacity: 0.15;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(30px, -30px) rotate(5deg); }
    50% { transform: translate(-20px, 20px) rotate(-5deg); }
    75% { transform: translate(20px, 30px) rotate(3deg); }
}

/* Left Panel - Brand Section */
.signin-brand {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 80px;
    position: relative;
    z-index: 10;
}

.signin-brand__logo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 80px;
    text-decoration: none;
}

.signin-brand__logo-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
}

.signin-brand__logo-text {
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.signin-brand__content {
    max-width: 520px;
}

.signin-brand__title {
    font-size: 3.5rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -1px;
}

.signin-brand__title span {
    background: linear-gradient(135deg, #6366f1, #06b6d4, #8b5cf6);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 5s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.signin-brand__desc {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
    margin-bottom: 50px;
}

/* Feature Cards */
.feature-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feature-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateX(8px);
}

.feature-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    flex-shrink: 0;
}

.feature-card__icon--purple {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.feature-card__icon--cyan {
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
}

.feature-card__icon--pink {
    background: linear-gradient(135deg, #ec4899, #f43f5e);
}

.feature-card__text h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.feature-card__text p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Right Panel - Form Section */
.signin-form-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    z-index: 10;
}

.signin-card {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 32px;
    padding: 48px 40px;
    box-shadow: 
        0 32px 64px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Mobile Logo */
.signin-mobile-logo {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
}

.signin-mobile-logo__icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
}

.signin-mobile-logo__text {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
}

/* Form Header */
.signin-card__header {
    text-align: center;
    margin-bottom: 36px;
}

.signin-card__title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.signin-card__subtitle {
    font-size: 0.938rem;
    color: rgba(255, 255, 255, 0.6);
}

.signin-card__subtitle a {
    color: #818cf8;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s;
}

.signin-card__subtitle a:hover {
    color: #a5b4fc;
}

/* Form Inputs */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i.field-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.4);
    font-size: 1rem;
    transition: all 0.3s;
    pointer-events: none;
}

.form-control {
    width: 100%;
    padding: 16px 18px 16px 52px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    font-size: 1rem;
    font-family: inherit;
    color: #fff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-control:focus {
    outline: none;
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.form-control:focus + i.field-icon,
.input-wrapper:focus-within i.field-icon {
    color: #818cf8;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 6px;
    transition: all 0.3s;
}

.password-toggle:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

/* Custom Checkbox */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-wrapper input {
    display: none;
}

.custom-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.custom-checkbox i {
    font-size: 0.7rem;
    color: #fff;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s;
}

.checkbox-wrapper input:checked + .custom-checkbox {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-color: transparent;
}

.checkbox-wrapper input:checked + .custom-checkbox i {
    opacity: 1;
    transform: scale(1);
}

.checkbox-text {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

.forgot-link {
    font-size: 0.875rem;
    color: #818cf8;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s;
}

.forgot-link:hover {
    color: #a5b4fc;
}

/* Submit Button */
.btn-signin {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.35);
    position: relative;
    overflow: hidden;
}

.btn-signin::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.btn-signin:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.5);
}

.btn-signin:hover::before {
    left: 100%;
}

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

.btn-signin i {
    transition: transform 0.3s;
}

.btn-signin:hover i {
    transform: translateX(4px);
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 28px 0;
}

.divider__line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.divider__text {
    font-size: 0.813rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    white-space: nowrap;
}

/* Google Button */
.btn-google {
    width: 100%;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    font-size: 0.938rem;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-google:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.btn-google__icon {
    width: 22px;
    height: 22px;
}

/* Terms */
.signin-terms {
    margin-top: 28px;
    text-align: center;
    font-size: 0.813rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.7;
}

.signin-terms a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s;
}

.signin-terms a:hover {
    color: #818cf8;
}

/* Back Link */
.back-link {
    position: fixed;
    top: 40px;
    right: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: all 0.3s;
    z-index: 100;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.back-link:hover {
    color: #fff;
}

.back-link i {
    font-size: 0.75rem;
    transition: transform 0.3s;
}

.back-link:hover i {
    transform: translateX(-4px);
}

/* Loading State */
.btn-signin.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-signin.loading span {
    opacity: 0;
}

.btn-signin.loading::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border: 3px solid transparent;
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Input States */
.form-control.error {
    border-color: #f43f5e;
    background: rgba(244, 63, 94, 0.1);
}

.form-control.success {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

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

@media (max-width: 1200px) {
    .signin-brand {
        padding: 40px 50px;
    }
    
    .signin-brand__title {
        font-size: 2.75rem;
    }
}

@media (max-width: 1024px) {
    .signin-brand {
        display: none;
    }
    
    .signin-form-section {
        flex: 1;
        padding: 40px 24px;
    }
    
    .signin-mobile-logo {
        display: flex;
    }
    
    .back-link {
        top: 20px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    .signin-form-section {
        padding: 80px 16px 24px;
    }
    
    .signin-card {
        padding: 32px 24px;
        border-radius: 24px;
    }
    
    .signin-card__title {
        font-size: 1.5rem;
    }
    
    .form-options {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .back-link {
        top: 16px;
        right: 16px;
        padding: 8px 14px;
        font-size: 0.813rem;
    }
}

/* ===================================
   Animations
   =================================== */

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.signin-brand__content {
    animation: fadeInLeft 0.8s ease-out;
}

.feature-card {
    animation: fadeInLeft 0.8s ease-out backwards;
}

.feature-card:nth-child(1) { animation-delay: 0.2s; }
.feature-card:nth-child(2) { animation-delay: 0.4s; }
.feature-card:nth-child(3) { animation-delay: 0.6s; }

.signin-card {
    animation: fadeInUp 0.8s ease-out;
}

.signin-card__header,
.form-group,
.form-options,
.btn-signin,
.divider,
.btn-google,
.signin-terms {
    animation: fadeInUp 0.6s ease-out backwards;
}

.signin-card__header { animation-delay: 0.1s; }
.form-group:nth-child(1) { animation-delay: 0.2s; }
.form-group:nth-child(2) { animation-delay: 0.3s; }
.form-options { animation-delay: 0.4s; }
.btn-signin { animation-delay: 0.5s; }
.divider { animation-delay: 0.6s; }
.btn-google { animation-delay: 0.7s; }
.signin-terms { animation-delay: 0.8s; }

/* ===================================
   User Role Tabs
   =================================== */
.user-role-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
    position: relative;
}

.user-role-tabs input[type="radio"] {
    display: none;
}

.user-role-tabs .role-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
}

.user-role-tabs .role-tab i {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.user-role-tabs .role-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

/* Active state for Student tab (first) */
.user-role-tabs input[type="radio"]#role_student:checked ~ label[for="role_student"] {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    border-color: #6366f1;
    color: #fff;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.user-role-tabs input[type="radio"]#role_student:checked ~ label[for="role_student"] i {
    transform: scale(1.1);
}

/* Active state for Graduate tab (second) */
.user-role-tabs input[type="radio"]#role_graduate:checked ~ label[for="role_graduate"] {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    border-color: #6366f1;
    color: #fff;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.user-role-tabs input[type="radio"]#role_graduate:checked ~ label[for="role_graduate"] i {
    transform: scale(1.1);
}

/* ===================================
   Birth Date Grid
   =================================== */
.birth-date-grid {
    display: grid;
    grid-template-columns: 1fr 2fr 1.5fr;
    gap: 12px;
}

.birth-date-grid .input-wrapper {
    margin-bottom: 0;
}

.birth-date-grid select.form-control {
    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='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* Mobile responsive for birth date */
@media (max-width: 480px) {
    .birth-date-grid {
        grid-template-columns: 1fr;
    }
}

/* ===================================
   Larger Form Card for Registration Steps
   =================================== */
.signin-card.signin-card--large {
    max-width: 520px;
}

/* ===================================
   Custom Select-Input Component
   =================================== */
.birth-date-inputs {
    display: flex;
    gap: 12px;
}

.birth-input-group {
    flex: 1;
}

.birth-input-group--year {
    flex: 1.3;
}

.custom-select-input {
    position: relative;
}

.custom-select-input .form-control {
    padding-left: 18px;
    cursor: text;
}

.custom-select-input[data-type="country"] .form-control {
    padding-left: 52px;
    padding-right: 40px;
}

.dropdown-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
    pointer-events: none;
    transition: transform 0.3s ease;
}

.custom-select-input.active .dropdown-arrow {
    transform: translateY(-50%) rotate(180deg);
}

.select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(15, 15, 35, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    margin-top: 8px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.select-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.select-dropdown--country {
    max-height: 280px;
}

/* Scrollbar styling */
.select-dropdown::-webkit-scrollbar {
    width: 6px;
}

.select-dropdown::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.select-dropdown::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.4);
    border-radius: 3px;
}

.select-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.6);
}

.select-option {
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.95rem;
}

.select-option:hover,
.select-option.highlighted {
    background: rgba(99, 102, 241, 0.2);
    color: #fff;
}

.select-option:first-child {
    border-radius: 12px 12px 0 0;
}

.select-option:last-child {
    border-radius: 0 0 12px 12px;
}

.select-option:only-child {
    border-radius: 12px;
}

.no-results {
    padding: 16px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    font-size: 0.9rem;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .birth-date-inputs {
        gap: 8px;
    }
    
    .select-dropdown {
        max-height: 180px;
    }
}
