:root {
    --teal-1: #0aa7c7;
    --teal-2: #5ad7e4;
    --teal-3: #0f7f94;
    --text-dark: #2e465b;
    --card-bg: rgba(247, 251, 255, 0.92);
    --input-border: #cddbe7;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    background:
        radial-gradient(circle at 12% 20%, rgba(90, 215, 228, 0.45), transparent 46%),
        radial-gradient(circle at 88% 18%, rgba(35, 176, 201, 0.24), transparent 38%),
        linear-gradient(115deg, #0ea8c4 0%, #7be1ec 40%, #edf6fb 78%, #f5f8fc 100%);
    overflow-x: hidden;
}

.login-page {
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
}

.login-shell {
    width: min(1180px, 100%);
    min-height: min(580px, calc(100svh - 28px));
    border-radius: 24px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 0.95fr;
    box-shadow: 0 28px 60px rgba(25, 67, 97, 0.22);
}

.brand-panel {
    padding: 34px 32px;
    background:
        radial-gradient(circle at 20% 16%, rgba(255, 255, 255, 0.18), transparent 35%),
        linear-gradient(160deg, rgba(5, 150, 178, 0.96) 0%, rgba(91, 215, 228, 0.88) 100%);
    color: #e8fbff;
    position: relative;
}

.brand-panel::before,
.brand-panel::after {
    content: "";
    position: absolute;
    left: -18%;
    right: -12%;
    border-radius: 50%;
    pointer-events: none;
}

.brand-panel::before {
    bottom: 168px;
    height: 300px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05));
    transform: rotate(-7deg);
}

.brand-panel::after {
    bottom: 24px;
    height: 220px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.08));
    transform: rotate(-5deg);
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: clamp(1.4rem, 1.8vw, 1.8rem);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 42px;
}

.brand-logo {
    width: 62px;
    height: 62px;
    display: inline-grid;
    place-items: center;
}

.brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-panel h1 {
    font-size: clamp(1.5rem, 2vw, 2.2rem);
    line-height: 1.15;
    margin: 0;
    font-weight: 600;
    max-width: 520px;
}

.tagline {
    margin-top: 14px;
    margin-bottom: 8px;
    font-size: clamp(1.12rem, 1.35vw, 1.35rem);
    color: #eefcff;
}

.subline {
    margin: 0;
    font-size: clamp(0.98rem, 1.2vw, 1.15rem);
    color: rgba(230, 252, 255, 0.95);
}

.book-stack {
    width: 90px;
    height: 90px;
    border-radius: 24px;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.24), transparent 42%),
        linear-gradient(140deg, #8deaf2, #24b7cb 52%, #0d92ad);
    box-shadow: 20px 18px 30px rgba(17, 105, 124, 0.35);
    position: absolute;
    left: 60%;
    bottom: 34px;
    transform: rotate(-4deg);
    z-index: 1;
}

.book-stack::before,
.book-stack::after {
    content: "";
    position: absolute;
    width: 88%;
    height: 88%;
    border-radius: 18px;
    right: -20px;
    top: 18px;
    background: linear-gradient(140deg, #9deef5, #40cbda);
    z-index: -1;
}

.book-stack::after {
    width: 78%;
    height: 78%;
    right: -34px;
    top: 34px;
    background: linear-gradient(140deg, #b6f4f8, #6ddce8);
}

.form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(243, 248, 252, 0.9));
    padding: 20px;
}

.form-card {
    width: min(420px, 100%);
    background: var(--card-bg);
    border-radius: 22px;
    padding: 28px 28px 22px;
    box-shadow: 0 24px 42px rgba(63, 88, 112, 0.2);
}

.form-card h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0 0 16px;
    font-size: clamp(2rem, 2.4vw, 2.45rem);
    line-height: 1;
    color: var(--teal-3);
}

.login-title-icon {
    width: 62px;
    height: 62px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    align-self: center;
}

.login-title-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.form-card form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-card input {
    width: 100%;
    border: 1px solid var(--input-border);
    border-radius: 12px;
    padding: 18px 13px 8px 44px;
    font-size: 0.98rem;
    color: #42576a;
    background-color: rgba(255, 255, 255, 0.93);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.form-card input:focus {
    outline: none;
}

.form-field {
    position: relative;
}

.floating-label {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%) scale(1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #607286;
    font-size: 0.95rem;
    font-weight: 500;
    pointer-events: none;
    transition: top 0.22s ease, transform 0.22s ease, color 0.22s ease;
}

.label-icon {
    width: 18px;
    height: 18px;
    color: #74b7c8;
    transition: color 0.2s ease, transform 0.25s ease;
}

.label-icon svg {
    width: 100%;
    height: 100%;
    display: block;
    fill: currentColor;
}

.field-line {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 1px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, #1da7c3, #65dbe6);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.form-field:focus-within input {
    border-color: #65cddb;
    box-shadow: 0 0 0 4px rgba(87, 203, 221, 0.18);
    transform: translateX(4px);
}

.form-field:focus-within .field-line {
    transform: scaleX(1);
}

.form-field:focus-within .floating-label,
.form-field input:not(:placeholder-shown)+.floating-label {
    top: 6px;
    transform: translateY(-8px) scale(0.88);
    color: #178aa4;
}

.form-field:focus-within .label-icon,
.form-field input:not(:placeholder-shown)+.floating-label .label-icon {
    color: #1ca1bc;
    transform: translateX(1px);
}

.form-card button {
    margin-top: 8px;
    border: none;
    border-radius: 999px;
    padding: 11px;
    font-size: 1rem;
    font-weight: 600;
    color: #f6fcff;
    cursor: pointer;
    background: linear-gradient(90deg, #0ea4c3 0%, #62d9e4 100%);
    box-shadow: 0 14px 24px rgba(24, 132, 158, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.form-card button:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 28px rgba(24, 132, 158, 0.35);
}

.remember-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
    color: #52677c;
    font-size: 0.94rem;
    font-weight: 500;
    cursor: pointer;
}

.remember-toggle input {
    width: 16px;
    height: 16px;
    margin: 0;
    padding: 0;
    border-radius: 4px;
    accent-color: #1599b5;
    flex: 0 0 auto;
}

.forgot-link {
    display: block;
    text-align: center;
    margin-top: 12px;
    font-size: 0.92rem;
    color: #60778f;
    text-decoration: none;
}

.forgot-link:hover {
    color: #2f6988;
    text-decoration: underline;
}

.error {
    margin: 0 0 16px;
    color: #c52828;
    background: #ffe6e6;
    border: 1px solid #ffc9c9;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 1rem;
}

@media (max-width: 1024px) {
    .login-shell {
        grid-template-columns: 1fr;
        max-width: 640px;
        min-height: auto;
    }

    .brand-panel {
        min-height: 210px;
        padding: 28px 24px;
    }

    .brand-mark {
        margin-bottom: 16px;
    }

    .brand-panel h1 {
        font-size: 1.6rem;
        max-width: none;
    }

    .tagline,
    .subline {
        font-size: 1rem;
    }

    .book-stack {
        width: 70px;
        height: 70px;
        left: auto;
        right: 24px;
        bottom: 16px;
    }

    .form-card {
        border-radius: 20px;
        padding: 24px 20px 20px;
    }

    .form-card h2 {
        font-size: 1.95rem;
    }

    .floating-label {
        font-size: 0.9rem;
    }

    .form-card button {
        font-size: 0.95rem;
    }
}

@media (max-width: 560px) {
    .login-page {
        padding: 10px;
    }

    .brand-panel h1 {
        font-size: 1.32rem;
    }

    .tagline,
    .subline {
        font-size: 0.92rem;
    }

    .form-card h2 {
        font-size: 1.65rem;
    }

    .floating-label {
        font-size: 0.86rem;
    }

    .form-card input,
    .form-card button {
        font-size: 0.9rem;
    }
}
