:root {
    --primary-color: #8A4FFF;
    --text-dark: #1F2937;
    --text-gray: #6B7280;
    --border-color: #E5E7EB;
    --bg-light: #FFFFFF;
    --bg-illustration: #A78BFA;
    --cloud-color: rgba(255, 255, 255, 0.3);
    --error-bg: #FEF2F2;
    --error-text: #B91C1C;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-light);
    min-height: 100vh;
    color: var(--text-dark);
    overflow-x: hidden;
}

.page-wrapper {
    display: flex;
    width: 100vw;
    min-height: 100vh;
}

.login-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 5% 10%;
    background-color: var(--bg-light);
    min-width: 450px;
    position: relative;
}

.login-main {
    flex: 0 0 auto;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 60px;
    position: absolute;
    top: 5%;
    left: 10%;
    color: var(--text-dark);
}

.logo-box {
    width: 14px;
    height: 14px;
    background-color: var(--primary-color);
    border-radius: 4px;
}

.welcome-text h1 {
    font-size: 3.2rem;
    line-height: 1.2;
    margin-bottom: 15px;
    font-weight: 700;
}

.welcome-text p {
    color: var(--text-gray);
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.auth-alert {
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--error-bg);
    color: var(--error-text);
    font-size: 0.95rem;
    margin-bottom: 20px;
    border: 1px solid #FECACA;
}

.auth-alert--ok {
    background: #ECFDF5;
    color: #047857;
    border-color: #A7F3D0;
}

.field-error {
    color: var(--error-text);
    font-size: 0.85rem;
    margin-top: 6px;
}

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

.input-field {
    width: 100%;
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-color);
}

.input-field.is-invalid {
    border-color: #F87171;
}

.password-wrap {
    position: relative;
}

.password-wrap .input-field {
    padding-right: 48px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 4px;
    color: var(--text-gray);
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    margin-bottom: 30px;
    color: var(--text-gray);
}

.remember-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

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

.forgot-link {
    text-decoration: none;
    color: var(--text-gray);
}

.forgot-link:hover {
    color: var(--primary-color);
}

.btn-submit {
    width: 180px;
    padding: 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-submit:hover {
    background-color: #713adb;
}

.footer-link {
    position: absolute;
    bottom: 5%;
    left: 10%;
    font-size: 0.95rem;
    color: var(--text-gray);
}

.footer-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.footer-link a:hover {
    text-decoration: underline;
}

.footer-extra {
    margin-top: 8px;
    font-size: 0.85rem;
}

.footer-extra a {
    color: var(--text-gray);
    font-weight: 500;
}

.illustration-section {
    flex: 1.3;
    background: linear-gradient(160deg, #b194f5 0%, #8a4fff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-top-left-radius: 30px;
    border-bottom-left-radius: 30px;
}

.illustration-content {
    text-align: center;
    color: white;
    padding: 20px;
}

.illustration-content strong {
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
    margin-bottom: 8px;
}

.clouds {
    position: absolute;
    background-color: var(--cloud-color);
    border-radius: 50px;
}

.cloud-1 { width: 150px; height: 50px; top: 15%; left: 15%; }
.cloud-2 { width: 180px; height: 60px; bottom: 20%; right: 10%; }

@media (max-width: 900px) {
    .page-wrapper {
        flex-direction: column;
    }

    .illustration-section {
        display: none;
    }

    .login-section {
        width: 100vw;
        min-height: 100vh;
        min-width: unset;
        padding: 10vh 10vw;
        justify-content: flex-start;
    }

    .login-main {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: 0;
    }

    .logo-area,
    .footer-link {
        position: static;
        margin-bottom: 40px;
        left: unset;
        top: unset;
        bottom: unset;
    }

    .footer-link {
        flex-shrink: 0;
        margin-top: auto;
        margin-bottom: 0;
        padding-top: 20px;
    }

    .welcome-text h1 {
        font-size: 2.5rem;
    }

    .btn-submit {
        width: 100%;
    }
}
