/* ==========================================================
   VAT Invoice System - Login page
   Split card with a curved green panel. Self-contained.
   ========================================================== */

.auth, .auth *, .auth *::before, .auth *::after { box-sizing: border-box; }

.auth {
    --green: #12805c;
    --green-dark: #0b5f44;
    --green-light: #1fa174;
    --tint: #cfeadc;
    --tint-focus: #bfe3d0;
    --ink: #17352b;
    --muted: #5f7a70;
    --danger: #d33a3a;

    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
    background: #e9f1ee;
    -webkit-font-smoothing: antialiased;
}

.auth svg {
    width: 22px; height: 22px;
    fill: none; stroke: currentColor; stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Stage & card ---------- */
.stage {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 16px;
}

.login {
    position: relative;
    display: flex;
    width: 100%;
    max-width: 940px;
    min-height: 540px;
    overflow: hidden;
    background: #fff;
    border-radius: 26px;
    box-shadow: 0 30px 70px -20px rgba(11, 95, 68, .35);
}

/* ==========================================================
   GREEN CURVED PANEL (left)
   ========================================================== */
.side {
    position: relative;
    flex: 0 0 47%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 48px 40px 36px;
    color: #fff;
    text-align: center;
    background:
        radial-gradient(circle at 15% 12%, rgba(255, 255, 255, .16), transparent 42%),
        linear-gradient(160deg, var(--green-light) 0%, var(--green) 50%, var(--green-dark) 100%);
    border-radius: 0 52% 52% 0 / 0 46% 46% 0;
    z-index: 1;
}

/* soft decorative rings */
.side::before, .side::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, .14);
    pointer-events: none;
}
.side::before { width: 260px; height: 260px; left: -90px; bottom: -80px; }
.side::after  { width: 150px; height: 150px; left: 24px; top: -50px; }

.side-inner { position: relative; max-width: 290px; }

.logo {
    display: inline-grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: 10px;
    border-radius: 50%;
    background: #fff;
    color: var(--green);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .18);
}
.logo svg { width: 30px; height: 30px; }

.side-brand { display: block; margin-bottom: 38px; font-size: 19px; font-weight: 700; letter-spacing: .3px; }

.side h2 { margin: 0 0 12px; font-size: 30px; font-weight: 800; letter-spacing: -.4px; }
.side p { margin: 0 0 30px; font-size: 14px; color: rgba(255, 255, 255, .85); }

.tag {
    display: inline-block;
    padding: 10px 34px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 1.4px;
    border: 1.5px solid rgba(255, 255, 255, .85);
    border-radius: 999px;
}

/* ==========================================================
   FORM (right)
   ========================================================== */
.main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 44px 40px 24px;
}

.form-box { width: 100%; max-width: 340px; text-align: center; }

.form-box h1 {
    margin: 0 0 6px;
    font-size: 40px;
    font-weight: 800;
    letter-spacing: -.8px;
    color: var(--green);
}
.sub { margin: 0 0 30px; font-size: 14px; color: var(--muted); }

.field { margin-bottom: 18px; text-align: left; }

.auth input {
    width: 100%;
    height: 50px;
    padding: 0 22px;
    font: inherit;
    color: var(--ink);
    background: var(--tint);
    border: 2px solid transparent;
    border-radius: 999px;
    transition: background .15s, border-color .15s, box-shadow .15s;
}
.auth input::placeholder { color: #5f8a79; }
.auth input:hover { background: var(--tint-focus); }
.auth input:focus {
    outline: none;
    background: #fff;
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(18, 128, 92, .15);
}

/* Hide the browser's built-in password reveal icon (Edge/IE) so only ours shows */
.auth input::-ms-reveal,
.auth input::-ms-clear { display: none; width: 0; height: 0; }
.auth input::-webkit-credentials-auto-fill-button { visibility: hidden; position: absolute; right: 0; }

.pass { position: relative; }
.pass input { padding-right: 76px; }

.show {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: var(--green);
    background: rgba(255, 255, 255, .7);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: background .15s, transform .15s;
}
.show svg { width: 19px; height: 19px; grid-area: 1 / 1; transition: opacity .2s, transform .25s; }
.show .eye-closed { opacity: 0; transform: scale(.5) rotate(-30deg); }
.show.on .eye-open { opacity: 0; transform: scale(.5) rotate(30deg); }
.show.on .eye-closed { opacity: 1; transform: none; }
.show:hover { background: #fff; transform: translateY(-50%) scale(1.08); }
.show:active { transform: translateY(-50%) scale(.94); }
.show:focus-visible { outline: 2px solid var(--green); }

.has-error input { border-color: var(--danger); background: #fdeeee; }
.has-error input:focus { box-shadow: 0 0 0 4px rgba(211, 58, 58, .15); }
.msg { margin: 6px 0 0 20px; font-size: 13px; font-weight: 500; color: var(--danger); }

.caps { display: none; margin: 6px 0 0 20px; font-size: 12.5px; font-weight: 500; color: #b45309; }
.caps.on { display: block; }

/* ---------- Button ---------- */
.submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 170px;
    height: 48px;
    margin-top: 10px;
    padding: 0 40px;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 1.2px;
    color: #fff;
    background: linear-gradient(135deg, var(--green-light), var(--green));
    border: 0;
    border-radius: 999px;
    box-shadow: 0 10px 22px rgba(18, 128, 92, .35);
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, filter .15s;
}
.submit:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 14px 28px rgba(18, 128, 92, .42); }
.submit:active { transform: translateY(0); }
.submit:focus-visible { outline: 3px solid rgba(18, 128, 92, .35); outline-offset: 3px; }
.submit:disabled { cursor: wait; opacity: .85; }

.spinner {
    display: none;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
.submit.loading .label { display: none; }
.submit.loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.foot { margin: 34px 0 0; font-size: 12px; color: var(--muted); }

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 860px) {
    .side { padding: 32px 40px 32px 28px; }
    .side h2 { font-size: 26px; }
    .form-box h1 { font-size: 34px; }
}

/* Mobile: green curved header on top, form below */
@media (max-width: 680px) {
    .stage { padding: 0; align-items: stretch; background: #fff; }

    .login {
        flex-direction: column;
        max-width: none;
        min-height: 100vh;
        border-radius: 0;
        box-shadow: none;
    }

    .side {
        flex: 0 0 auto;
        padding: 40px 28px 64px;
        border-radius: 0 0 50% 50% / 0 0 38px 38px;
    }
    .side::before, .side::after { display: none; }

    .side-inner { max-width: 340px; }
    .logo { width: 56px; height: 56px; }
    .side-brand { margin-bottom: 18px; }
    .side h2 { font-size: 24px; margin-bottom: 8px; }
    .side p { margin-bottom: 0; }
    .tag { display: none; }

    .main { align-items: flex-start; padding: 30px 24px 36px; }
    .form-box h1 { font-size: 32px; }
    .submit { width: 100%; }
}

/* ==========================================================
   ANIMATIONS
   ========================================================== */
@keyframes cardIn {
    from { opacity: 0; transform: translateY(24px) scale(.97); }
    to   { opacity: 1; transform: none; }
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
}
@keyframes popIn {
    0%   { opacity: 0; transform: scale(.4); }
    70%  { opacity: 1; transform: scale(1.1); }
    100% { transform: scale(1); }
}
@keyframes floaty {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-7px); }
}
@keyframes drift {
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(14px, -12px); }
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* card entrance */
.login { animation: cardIn .6s cubic-bezier(.2, .8, .2, 1) both; }

/* green panel: logo pops in then floats, text staggers up */
.logo { animation: popIn .6s .25s cubic-bezier(.2, .8, .2, 1) both, floaty 5s 1s ease-in-out infinite; }
.side-brand  { animation: fadeUp .5s .35s both; }
.side h2     { animation: fadeUp .5s .45s both; }
.side p      { animation: fadeUp .5s .55s both; }
.tag         { animation: fadeUp .5s .65s both; }
.side::before { animation: drift 9s ease-in-out infinite; }
.side::after  { animation: drift 11s -4s ease-in-out infinite; }

/* form: elements stagger up */
.form-box h1 { animation: fadeUp .5s .3s both; }
.sub         { animation: fadeUp .5s .4s both; }
.form-box .field:nth-of-type(1) { animation: fadeUp .5s .5s both; }
.form-box .field:nth-of-type(2) { animation: fadeUp .5s .6s both; }
.submit      { animation: fadeUp .5s .7s backwards; } /* backwards: keeps hover lift working */
.foot        { animation: fadeUp .5s .8s both; }

/* error fields shake once */
.has-error input { animation: shake .4s ease; }

/* gentle lift on field hover/focus */
.auth input:focus { transform: translateY(-1px); }

/* button shine sweep on hover */
.submit { position: relative; overflow: hidden; }
.submit::after {
    content: "";
    position: absolute;
    top: 0; left: -80%;
    width: 50%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .35), transparent);
    transform: skewX(-20deg);
}
.submit:hover::after { left: 130%; transition: left .6s ease; }

@media (prefers-reduced-motion: reduce) {
    .login, .logo, .side-brand, .side h2, .side p, .tag, .side::before, .side::after,
    .form-box h1, .sub, .form-box .field, .submit, .foot, .has-error input { animation: none !important; }
    .spinner { animation-duration: 1.6s; }
    .submit, .submit::after, .auth input, .show, .show svg { transition: none; }
}
