/* ============================================
   Music Conservatory - Login Page Styles
   Based on Akkhor / Akademi Template Design
   ============================================ */

:root {
    --primary: #6C5CE7;
    --primary-dark: #5A4BD1;
    --primary-light: #A29BFE;
    --primary-bg: #DDD6FE;
    --secondary: #F97316;
    --secondary-dark: #EA580C;
    --secondary-light: #FDBA74;
    --text-dark: #2D3436;
    --text-muted: #636E72;
    --text-light: #B2BEC3;
    --bg-light: #F0F0F8;
    --bg-white: #FFFFFF;
    --border: #E2E8F0;
    --success: #00B894;
    --danger: #E17055;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --font-kh: 'Battambang', 'Khmer OS', 'Khmer OS Battambang', cursive;
    --font-en: 'Poppins', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-kh);
    background: var(--bg-light);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Login Wrapper */
.login-wrapper {
    display: flex;
    width: 100vw;
    height: 100vh;
    background: var(--bg-white);
    overflow: hidden;
}

/* Left Side */
.login-left {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #EEF0FB 0%, #E8E6F5 50%, #F0EDF8 100%);
    overflow: hidden;
    padding: 40px;
}

/* Hexagonal Pattern Background */
.hex-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.15;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 56 100'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 100' fill='none' stroke='%236C5CE7' stroke-width='1'/%3E%3Cpath d='M28 0L28 34L0 50L0 84L28 100L56 84L56 50L28 34' fill='none' stroke='%236C5CE7' stroke-width='0.5'/%3E%3C/svg%3E");
    background-size: 56px 100px;
}

/* Animated connecting lines */
.login-left::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 20% 30%, rgba(108, 92, 231, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(249, 115, 22, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(108, 92, 231, 0.04) 0%, transparent 60%);
    animation: bgPulse 15s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-2%, -1%) scale(1.02); }
    100% { transform: translate(1%, 2%) scale(1); }
}

/* Brand Header */
.brand-header {
    position: relative;
    z-index: 2;
    margin-bottom: 30px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: var(--primary);
    border-radius: var(--radius-md);
    font-size: 26px;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
}

.logo-text {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary);
    font-family: var(--font-kh);
    text-shadow: 0 2px 4px rgba(108, 92, 231, 0.1);
}

/* Illustration */
.illustration {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.illustration-svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.08));
}

/* Floating animation for notes */
.float-note-1 {
    animation: floatNote 3s ease-in-out infinite;
}

.float-note-2 {
    animation: floatNote 4s ease-in-out 0.5s infinite;
}

.float-note-3 {
    animation: floatNote 3.5s ease-in-out 1s infinite;
}

@keyframes floatNote {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50% { transform: translateY(-12px); opacity: 1; }
}

/* Right Side */
.login-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 60px;
    background: var(--bg-white);
    position: relative;
}

.login-right::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary), var(--secondary), var(--primary));
    opacity: 0.3;
}

/* Login Form Container */
.login-form-container {
    width: 100%;
    max-width: 420px;
}

/* Title */
.login-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-family: var(--font-kh);
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 30px;
    line-height: 1.6;
}

/* Social Login Buttons */
.social-login {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 13px 20px;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-kh);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-social::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    pointer-events: none;
}

.btn-social:hover::after {
    width: 300%;
    height: 300%;
}

.btn-google {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.35);
}

.btn-google:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.45);
}

.btn-facebook {
    background: var(--secondary);
    color: white;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.35);
}

.btn-facebook:hover {
    background: var(--secondary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.45);
}

.btn-social i {
    font-size: 18px;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 24px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.divider span {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-wrapper i:first-child {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 14px;
    transition: var(--transition);
    z-index: 1;
    pointer-events: none;
    line-height: 1;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 44px 14px 44px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: var(--font-kh);
    color: var(--text-dark);
    background: var(--bg-white);
    transition: var(--transition);
    outline: none;
    box-sizing: border-box;
}

.input-wrapper input::placeholder {
    color: var(--text-light);
    font-family: var(--font-en);
}

.input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.1);
}

.input-wrapper input:focus ~ i:first-child,
.input-wrapper input:focus + .toggle-password ~ i:first-child {
    color: var(--primary);
}

.input-wrapper:has(input:focus) i:first-child {
    color: var(--primary);
}

/* Toggle Password */
.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 16px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 2;
    line-height: 1;
    border-radius: 50%;
}

.toggle-password:hover {
    color: var(--primary);
    background: rgba(108, 92, 231, 0.08);
}

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

/* Custom Checkbox */
.remember-me {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-muted);
    position: relative;
    padding-left: 28px;
    user-select: none;
}

.remember-me input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 20px;
    width: 20px;
    z-index: 2;
}

.checkmark {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 20px;
    width: 20px;
    background: var(--bg-light);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.remember-me input:checked ~ .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

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

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

.forgot-link {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.forgot-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Sign Up Link */
.signup-link {
    font-size: 14px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.signup-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Login Button */
.btn-login {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    font-size: 16px;
    font-weight: 700;
    font-family: var(--font-kh);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.35);
    position: relative;
    overflow: hidden;
    margin-top: 4px;
}

.btn-login::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    pointer-events: none;
}

.btn-login:hover::after {
    width: 300%;
    height: 300%;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.45);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

/* Error State */
.input-wrapper.error input {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(225, 112, 85, 0.1);
}

.input-wrapper.error i:first-child {
    color: var(--danger);
}

.error-message {
    font-size: 12px;
    color: var(--danger);
    margin-top: 2px;
    display: none;
}

.error-message.show {
    display: block;
    animation: slideDown 0.3s ease;
}

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

/* Toast Notification */
.toast {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 10000;
    transform: translateX(calc(100% + 40px));
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--success);
    min-width: 280px;
}

.toast.error .toast-content {
    border-left-color: var(--danger);
}

.toast-icon {
    font-size: 20px;
    color: var(--success);
}

.toast.error .toast-icon {
    color: var(--danger);
}

.toast-message {
    font-size: 14px;
    color: var(--text-dark);
    font-weight: 500;
}

/* Shake animation for form errors */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease;
}

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

@media (max-width: 1024px) {
    .login-left {
        display: none;
    }

    .login-right {
        flex: 1;
        padding: 40px 30px;
    }

    .login-right::before {
        display: none;
    }

    .login-form-container {
        max-width: 450px;
    }

    /* Show brand on mobile */
    .login-form-container::before {
        content: '🎵 មហាវិទ្យាល័យតន្ត្រី';
        display: block;
        font-size: 24px;
        font-weight: 700;
        color: var(--primary);
        text-align: center;
        margin-bottom: 30px;
    }
}

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

    .login-title {
        font-size: 24px;
    }

    .btn-social {
        padding: 12px 16px;
        font-size: 14px;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (min-width: 1600px) {
    .login-form-container {
        max-width: 460px;
    }

    .login-title {
        font-size: 32px;
    }

    .illustration {
        max-width: 550px;
    }
}
