/* Global Styles */
:root {
    --primary-color: #7C3AED;
    --primary-dark: #6D28D9;
    --primary-light: #A78BFA;
    --secondary-color: #EC4899;
    --secondary-dark: #DB2777;
    --accent-color: #F59E0B;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --danger-color: #EF4444;
    --pending-color: #FBBF24;
    --graded-color: #10B981;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --login-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --card-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 30px 80px rgba(0, 0, 0, 0.12);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 16px;
    --border-radius-lg: 24px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--login-gradient);
    background-attachment: fixed;
    min-height: 100vh;
    color: #1f2937;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

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

/* Login Page Styles */
.login-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.animated-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
}

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

.shape-1 {
    width: 300px;
    height: 300px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    top: 60%;
    right: 15%;
    animation-delay: 5s;
}

.shape-3 {
    width: 150px;
    height: 150px;
    bottom: 20%;
    left: 20%;
    animation-delay: 10s;
}

.shape-4 {
    width: 250px;
    height: 250px;
    top: 30%;
    right: 10%;
    animation-delay: 15s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }
    33% {
        transform: translate(30px, -50px) scale(1.1);
        opacity: 0.5;
    }
    66% {
        transform: translate(-20px, 30px) scale(0.9);
        opacity: 0.4;
    }
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px);
    padding: 48px 40px;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.4);
    width: 100%;
    max-width: 440px;
    animation: loginAppear 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    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;
}

.login-card:hover::before {
    left: 100%;
}

@keyframes loginAppear {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.logo-container {
    margin: 0 auto 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo {
    width: 250px;
    height: auto;
    max-width: 100%;
    animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card h1 {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    font-size: 2em;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.subtitle {
    color: #6B7280;
    font-size: 0.95em;
    font-weight: 500;
}

.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #374151;
    font-weight: 600;
    font-size: 0.9em;
    letter-spacing: 0.3px;
}

.input-icon {
    width: 18px;
    height: 18px;
    color: var(--primary-color);
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #E5E7EB;
    border-radius: 14px;
    font-size: 15px;
    transition: var(--transition);
    font-family: inherit;
    background: #F9FAFB;
}

.input-group input:hover,
.input-group select:hover {
    border-color: #D1D5DB;
    background: white;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
    transform: translateY(-2px);
}

/* Remember Me Checkbox */
.remember-me-group {
    margin-bottom: 20px;
}

.remember-me-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-left: 35px;
}

.remember-me-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    left: 0;
    height: 22px;
    width: 22px;
    background: #F9FAFB;
    border: 2px solid #E5E7EB;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.remember-me-label:hover .checkmark {
    border-color: var(--primary-color);
    background: white;
}

.remember-me-label input:checked ~ .checkmark {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-color: var(--primary-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.remember-me-label input:checked ~ .checkmark:after {
    display: block;
}

.remember-text {
    color: #374151;
    font-weight: 500;
    font-size: 0.95em;
}

.btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 12px;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
}

.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 24px;
}

.btn-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

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

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn:hover::before {
    opacity: 1;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(124, 58, 237, 0.5);
}

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

.btn-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

.btn-secondary:hover {
    box-shadow: 0 10px 30px rgba(107, 114, 128, 0.4);
}

.alert {
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
}

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

.alert-error {
    background: #fee;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

.alert-success {
    background: #efe;
    color: var(--secondary-color);
    border: 1px solid var(--secondary-color);
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

/* Login Footer Inside Card */
.login-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #E5E7EB;
}

.login-footer p {
    margin: 0;
    color: #6B7280;
    font-size: 0.85em;
    font-weight: 500;
}

.login-footer strong {
    color: #374151;
    font-weight: 700;
}

.login-footer .developer-link {
    text-decoration: none;
}

.login-footer .developer-link strong {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
}

.login-footer .developer-link:hover strong {
    opacity: 0.8;
    text-decoration: underline;
}

/* Regular Footer */
.footer {
    text-align: center;
    padding: 24px 20px;
    margin-top: 40px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95em;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer p {
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.footer strong {
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer .developer-link {
    text-decoration: none;
    color: inherit;
}

.footer .developer-link strong {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
}

.footer .developer-link:hover strong {
    opacity: 0.8;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .login-card {
        padding: 36px 24px;
        max-width: 100%;
    }

    .login-header h1 {
        font-size: 1.6em;
    }

    .login-logo {
        width: 200px;
    }

    .subtitle {
        font-size: 0.9em;
    }

    .input-group input {
        padding: 14px 16px;
        font-size: 16px;
    }

    .btn-login {
        padding: 16px 20px;
    }

    .shape {
        opacity: 0.5;
    }

    .shape-1 {
        width: 200px;
        height: 200px;
    }

    .shape-2 {
        width: 150px;
        height: 150px;
    }

    .shape-3 {
        width: 100px;
        height: 100px;
    }

    .shape-4 {
        width: 180px;
        height: 180px;
    }

    .container {
        padding: 10px;
    }

    .footer {
        font-size: 0.85em;
        padding: 20px 15px;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 28px 20px;
    }

    .login-header {
        margin-bottom: 28px;
    }

    .login-header h1 {
        font-size: 1.4em;
    }

    .input-group {
        margin-bottom: 20px;
    }
}

/* Success Animation */
.success-animation {
    animation: successPulse 0.6s ease;
}

@keyframes successPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(124, 58, 237, 0.1);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.success-checkmark {
    width: 120px;
    height: 120px;
    animation: scaleUp 0.5s ease;
}

@keyframes scaleUp {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}

.success-checkmark svg {
    width: 100%;
    height: 100%;
}

.success-checkmark-circle {
    stroke: #10B981;
    stroke-width: 2;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.success-checkmark-check {
    stroke: #10B981;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.4s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}
