/* CSS Variables */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --white: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --success-bg: #d1fae5;
    --success-text: #065f46;
}

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

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Background Animation */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
    background: transparent;
}

.bg-animation::before,
.bg-animation::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 20s infinite ease-in-out;
}

.bg-animation::before {
    width: 300px;
    height: 300px;
    top: -150px;
    right: -150px;
    animation-delay: 0s;
}

.bg-animation::after {
    width: 200px;
    height: 200px;
    bottom: -100px;
    left: -100px;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(50px, 50px) rotate(90deg); }
    50% { transform: translate(-30px, 30px) rotate(180deg); }
    75% { transform: translate(30px, -50px) rotate(270deg); }
}

/* Standalone Back Button */
.back-btn-standalone {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    color: var(--text-dark);
    border: 1px solid #e5e7eb;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.back-btn-standalone:hover {
    background: var(--bg-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Main Content */
main {
    margin-top: 0;
    padding: 1rem 0 2rem 0;
    min-height: 100vh;
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease;
}

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

.hero-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border: 3px solid white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    text-shadow: none;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-weight: 300;
}

.hero-description {
    font-size: 0.9375rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}

/* Login Section */
.login-section {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease;
}

.login-form {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e1e5e9;
    max-width: 350px;
    width: 100%;
}

.form-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e1e5e9;
}

.form-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    color: white;
    font-size: 1rem;
}

.form-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.form-subtitle {
    color: var(--text-light);
    font-size: 0.8rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.375rem;
    color: var(--text-dark);
    font-size: 0.8rem;
}

.form-input {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

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

.error-message {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: none;
}

/* Input with button layout */
.input-with-button {
    display: flex;
    gap: 0.5rem;
}

.input-with-button .form-input {
    flex: 1;
    min-width: 0;
}

.input-with-button .btn {
    white-space: nowrap;
    padding: 0.625rem 0.75rem;
}

/* OTP Timer */
.otp-timer {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.25rem;
    font-style: italic;
}

.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: white;
    color: var(--text-dark);
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: var(--bg-light);
    border-color: #9ca3af;
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.register-section {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e1e5e9;
}

.register-text {
    color: var(--text-light);
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}

/* Auth Section (hidden by default) */
.auth-section {
    display: none;
    animation: fadeInUp 0.8s ease;
}

.auth-section.active {
    display: block;
}

/* Applications Section */
.applications-section {
    display: none;
    animation: fadeInUp 0.8s ease;
}

.applications-section.active {
    display: block;
}

.user-info-bar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e1e5e9;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1rem;
}

.logout-btn {
    background: transparent;
    color: var(--text-light);
    border: 1px solid #e5e7eb;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logout-btn:hover {
    background: var(--bg-light);
    border-color: #9ca3af;
}

.applications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.application-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e1e5e9;
    transition: all 0.3s ease;
}

.application-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.application-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.applicant-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.applicant-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.applicant-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-approved {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.application-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.detail-label {
    color: var(--text-light);
    font-weight: 500;
}

.detail-value {
    color: var(--text-dark);
    font-weight: 600;
}

.application-actions {
    display: flex;
    gap: 0.75rem;
}

.action-btn {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn:hover {
    background: var(--primary-color);
    color: white;
}

.action-btn.primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.action-btn.primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* Success Message */
.success-message {
    background: var(--success-bg);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success-text);
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    display: none;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Loading State */
.loading {
    display: none;
    text-align: center;
    padding: 1rem;
}

.spinner {
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    border-top: 2px solid var(--primary-color);
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
    margin: 0 auto 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .applications-grid {
        grid-template-columns: 1fr;
    }
    
    .user-info-bar {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .application-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .application-actions {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .login-form {
        padding: 1rem;
    }
}
