/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8fafc;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    color: #1a202c;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Login container */
.login-container {
    width: 100%;
    max-width: 480px;
    margin: 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
    position: relative;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ecc94b, #f6e05e);
}

.login-box {
    width: 100%;
    background: white;
    padding: 30px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    position: relative;
}

/* Logo */
.logo-container {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.logo-container::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #ecc94b, #f6e05e);
    border-radius: 3px;
}

.logo {
    width: 160px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Language Toggle */
.language-toggle {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
    background: #f8fafc;
    border-radius: 12px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 2px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}

.language-toggle::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: linear-gradient(135deg, #ecc94b 0%, #f6e05e 100%);
    border-radius: 8px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.language-toggle[data-lang="en"]::before {
    transform: translateX(100%);
}

.lang-btn {
    position: relative;
    z-index: 2;
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: #4a5568;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    font-family: inherit;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-btn:hover {
    color: #744210;
}

.lang-btn.active {
    color: #744210;
    font-weight: 700;
}

/* Typography */
.subtitle {
    color: #2d3748;
    text-align: center;
    margin-bottom: 24px;
    font-size: 16px;
    line-height: 1.5;
    font-weight: 500;
}

.subtitle::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #ecc94b, #f6e05e);
    border-radius: 3px;
}

/* Form elements */
.form-group {
    margin-bottom: 24px;
    position: relative;
    background: #ffffff;
    padding: 16px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.input-header {
    margin-bottom: 12px;
}

.label-with-icon {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.email-icon {
    width: 18px;
    height: 18px;
    display: block;
}

.password-icon {
    width: 18px;
    height: 18px;
    display: block;
}

.password-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* RTL support for password toggle */
[dir="rtl"] .password-toggle {
    right: auto;
    left: 16px;
}

.password-toggle:hover {
    background: rgba(236, 201, 75, 0.1);
}

.eye-icon {
    width: 20px;
    height: 20px;
    display: block;
    pointer-events: none;
}

label {
    display: block;
    color: #2d3748;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.025em;
}

input[type="email"],
input[type="password"],
input[type="text"] {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #f8fafc;
    color: #1a202c;
    height: 50px;
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus {
    border-color: #ecc94b;
    outline: none;
    background: white;
    box-shadow: 0 0 0 4px rgba(236, 201, 75, 0.1);
}

/* Special style for password when visible */
input[type="text"]#password {
    border-color: #ecc94b;
    background: white;
    box-shadow: 0 0 0 4px rgba(236, 201, 75, 0.1);
}

input[type="email"]::placeholder,
input[type="password"]::placeholder {
    color: #a0aec0;
    font-size: 14px;
}

/* Login button */
.login-button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #ecc94b 0%, #f6e05e 100%);
    color: #744210;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
}

.login-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f6e05e 0%, #ecc94b 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.login-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(236, 201, 75, 0.3);
}

.login-button:hover::before {
    opacity: 1;
}

.login-button:active {
    transform: translateY(0);
}

.login-button span {
    position: relative;
    z-index: 1;
}

/* Sign up link */
.signup-link {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: #4a5568;
}

.signup-link a {
    color: #744210;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    background: linear-gradient(135deg, #ecc94b 0%, #f6e05e 100%);
    border-radius: 8px;
    transition: all 0.3s ease;
    display: inline-block;
    margin-left: 8px;
    box-shadow: 0 2px 4px rgba(236, 201, 75, 0.2);
    font-size: 13px;
}

.signup-link a:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(236, 201, 75, 0.3);
}

.signup-link a:active {
    transform: translateY(0);
}

/* Forgot password link */
.forgot-password {
    text-align: right;
    margin: -8px 0 16px;
    font-size: 14px;
}

.forgot-password a {
    color: #4a5568;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.forgot-password a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, #ecc94b, #f6e05e);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.forgot-password a:hover {
    color: #ecc94b;
}

.forgot-password a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-weight: 500;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 2px solid #e2e8f0;
    animation: slideIn 0.3s ease-out;
}

.alert::before {
    content: '';
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

.alert-error {
    border-color: #feb2b2;
}

.alert-error::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23c53030'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z'/%3E%3C/svg%3E");
}

.alert-success {
    border-color: #ecc94b;
    position: relative;
}

.alert-success::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ecc94b'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z'/%3E%3C/svg%3E");
}

.alert-success::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #ecc94b, #f6e05e);
    border-radius: 0 0 12px 12px;
}

@keyframes slideIn {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive design */
@media (max-width: 480px) {
    body {
        padding: 12px;
    }

    .login-container {
        margin: 0;
        width: 100%;
    }

    .login-box {
        padding: 20px;
    }

    .logo {
        width: 120px;
    }

    .language-toggle {
        margin-bottom: 20px;
        padding: 3px;
    }

    .lang-btn {
        padding: 8px 12px;
        font-size: 13px;
        min-height: 32px;
    }

    .form-group {
        padding: 12px;
        margin-bottom: 16px;
    }

    input[type="email"],
    input[type="password"],
    input[type="text"] {
        height: 44px;
        padding: 12px 16px;
        font-size: 14px;
    }

    .login-button {
        padding: 12px;
        font-size: 15px;
    }

    .signup-link {
        font-size: 13px;
    }

    .signup-link a {
        padding: 6px 12px;
        font-size: 12px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .login-container {
        max-width: 420px;
    }
}

@media (min-width: 769px) {
    .login-container {
        max-width: 480px;
    }
}
