/* ═══════════════════════════════════════════════════════════════
   login.css  –  GobiShop · Centered Glassmorphism Login
   Background: user's toy-store image  (wwwroot/images/login-bg.jpg)
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --green:        #22c55e;
    --green-d:      #059669;
    --green-glow:   rgba(34, 197, 94, 0.35);
    --glass-bg:     rgba(255, 255, 255, 0.55);
    --glass-border: rgba(255, 255, 255, 0.75);
    --glass-shadow: rgba(0, 0, 0, 0.18);
    --text-dark:    #1a2e1e;
    --text-mid:     #3d5a42;
    --text-muted:   #6b8870;
    --input-bg:     rgba(255, 255, 255, 0.65);
    --input-border: rgba(255, 255, 255, 0.80);
    --input-focus:  rgba(34, 197, 94, 0.55);
    --error-bg:     rgba(239, 68, 68, 0.12);
    --error-border: rgba(239, 68, 68, 0.40);
    --error-text:   #b91c1c;

    --font-h: 'Outfit', system-ui, sans-serif;
    --font-b: 'Inter',  system-ui, sans-serif;
    --ease:   cubic-bezier(0.34, 1.56, 0.64, 1);
    --eout:   cubic-bezier(0.22, 1, 0.36, 1);
}

html, body { height: 100%; font-family: var(--font-b); }

/* ─── Full-screen background ─── */
.login-bg {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;

    /* USER'S IMAGE ↓ — save to wwwroot/images/login-bg.jpg */
    background-image: url('/Images/Login_background.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;

    /* Subtle overlay to ensure card contrast without darkening image */
    background-color: #d4edda;   /* fallback if image not yet copied */
}

/* Very light scrim so card always pops regardless of image brightness */
.login-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

/* ─── Glassmorphism card ─── */
.glass-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    padding: 2.5rem 2.25rem;
    margin: 1.5rem;

    background: var(--glass-bg);
    border: 1.5px solid var(--glass-border);
    border-radius: 28px;
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);

    box-shadow:
        0 8px 40px var(--glass-shadow),
        0 2px 0 rgba(255,255,255,0.9) inset,
        0 0 0 0.5px rgba(255,255,255,0.5) inset;

    animation: card-drop 0.55s var(--eout) both;
}

@keyframes card-drop {
    from { opacity: 0; transform: translateY(28px) scale(0.97); }
    to   { opacity: 1; transform: none; }
}

/* ─── Brand header ─── */
.glass-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.6rem;
}
.glass-mark svg {
    width: 44px; height: 44px;
    filter: drop-shadow(0 4px 12px rgba(34,197,94,0.45));
}
.glass-shop-name {
    font-family: var(--font-h);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.3px;
    line-height: 1.2;
}
.glass-shop-sub {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--green-d);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-top: 1px;
}

/* ─── Heading ─── */
.glass-heading {
    font-family: var(--font-h);
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.4px;
    margin-bottom: 4px;
}
.glass-hint {
    font-size: 0.83rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* ─── Error alert ─── */
.glass-alert {
    display: flex;
    align-items: center;
    gap: 9px;
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    border-radius: 10px;
    padding: 11px 14px;
    color: var(--error-text);
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 1.2rem;
    animation: shake 0.4s var(--ease);
}
.glass-alert svg { width: 16px; height: 16px; flex-shrink: 0; stroke-width: 2; }

@keyframes shake {
    0%,100% { transform: translateX(0); }
    20%     { transform: translateX(-5px); }
    40%     { transform: translateX(5px); }
    60%     { transform: translateX(-4px); }
    80%     { transform: translateX(3px); }
}

/* ─── Field ─── */
.g-field { margin-bottom: 1rem; }

.g-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-mid);
    margin-bottom: 6px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.g-wrap { position: relative; display: flex; align-items: center; }

.g-icon {
    position: absolute;
    left: 13px;
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
    transition: color 0.2s;
}
.g-icon svg { width: 16px; height: 16px; stroke-width: 1.8; }

.g-input {
    width: 100%;
    padding: 12px 42px;
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: 12px;
    color: var(--text-dark);
    font-family: var(--font-b);
    font-size: 0.9rem;
    font-weight: 400;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    -webkit-appearance: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.g-input::placeholder { color: var(--text-muted); }
.g-input:focus {
    border-color: var(--input-focus);
    background: rgba(255,255,255,0.80);
    box-shadow: 0 0 0 3.5px rgba(34,197,94,0.15);
}
.g-wrap:focus-within .g-icon { color: var(--green-d); }

.g-field--err .g-input {
    border-color: var(--error-border);
    background: rgba(255,255,255,0.75);
}
.g-field--err .g-input:focus {
    box-shadow: 0 0 0 3.5px rgba(239,68,68,0.12);
}

/* Eye toggle */
.g-eye {
    position: absolute;
    right: 11px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    display: flex;
    transition: color 0.2s;
}
.g-eye:hover { color: var(--text-mid); }
.g-eye svg { width: 16px; height: 16px; stroke-width: 1.8; }

/* ─── Submit button ─── */
.g-btn {
    width: 100%;
    margin-top: 0.4rem;
    padding: 13px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    background: linear-gradient(135deg, #22c55e 0%, #059669 55%, #0d9488 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-family: var(--font-h);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    position: relative;
    overflow: hidden;

    box-shadow: 0 6px 20px rgba(34,197,94,0.40), 0 2px 6px rgba(0,0,0,0.12);
    transition: transform 0.15s var(--ease), box-shadow 0.2s, opacity 0.2s;
}
.g-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, transparent 55%);
    opacity: 0;
    transition: opacity 0.2s;
}
.g-btn:hover:not(:disabled)::before { opacity: 1; }
.g-btn:hover:not(:disabled)  { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(34,197,94,0.50), 0 3px 10px rgba(0,0,0,0.15); }
.g-btn:active:not(:disabled) { transform: translateY(0) scale(0.99); }
.g-btn:disabled               { opacity: 0.65; cursor: not-allowed; }

.g-arrow { width: 17px; height: 17px; stroke-width: 2; transition: transform 0.2s; }
.g-btn:hover:not(:disabled) .g-arrow { transform: translateX(3px); }

.g-spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.65s linear infinite;
    flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Footer ─── */
.glass-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 1.5rem;
    font-size: 0.73rem;
    color: var(--text-muted);
    font-weight: 400;
}
.glass-footer svg { width: 13px; height: 13px; stroke-width: 2; color: var(--green-d); }

/* ─── Bottom watermark ─── */
.login-watermark {
    position: relative;
    margin-top: auto;
    padding: 1rem 0 0.5rem;
    text-align: center;
    font-size: 0.72rem;
    color: rgba(30, 60, 35, 0.65);
    white-space: nowrap;
    z-index: 1;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ─── Responsive & Mobile / Tablet Optimizations ─── */
@media (min-height: 600px) {
    .login-watermark {
        position: fixed;
        bottom: 14px;
        left: 50%;
        transform: translateX(-50%);
        margin-top: 0;
        padding: 0;
    }
}

/* Tablets & Small Laptops (768px - 1024px) */
@media (max-width: 1024px) {
    .glass-card {
        max-width: 420px;
        padding: 2.25rem 2rem;
    }
}

/* Mobile Devices & Small Tablets (up to 767px) */
@media (max-width: 767px) {
    .login-bg {
        padding: 1.25rem 1rem calc(1.25rem + env(safe-area-inset-bottom));
        justify-content: center;
    }

    .glass-card {
        max-width: 100%;
        margin: 0 auto;
        padding: 1.75rem 1.35rem;
        border-radius: 24px;
    }

    .glass-heading {
        font-size: 1.4rem;
    }

    .glass-hint {
        font-size: 0.8rem;
        margin-bottom: 1.25rem;
    }

    .g-input {
        padding: 14px 44px; /* Larger touch target for mobile keyboards */
        font-size: 16px; /* Prevents auto-zoom on iOS Safari */
    }

    .g-btn {
        padding: 14px 20px;
        font-size: 1rem;
        min-height: 48px; /* Touch-friendly tap target */
    }

    .g-eye {
        padding: 8px;
        right: 8px;
    }
}

/* Extra Small Mobile (below 380px) */
@media (max-width: 380px) {
    .glass-card {
        padding: 1.5rem 1.1rem;
        border-radius: 20px;
    }

    .glass-brand {
        margin-bottom: 1.2rem;
    }

    .glass-mark svg {
        width: 38px;
        height: 38px;
    }

    .glass-shop-name {
        font-size: 1.05rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .glass-card, .glass-alert { animation: none; }
}

