﻿/* ===============================
   Login Page Styles - BakeZone
   Cleaned: social sign-in & sign-up styles removed
   Full copy-paste for wwwroot/css/login.css
=============================== */

/* Page background + animation */
body {
    height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(-45deg, #ffe3b3, #ffb347, #ff7f50, #ffc371);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    transition: background 0.3s ease;
}

    /* Dark Mode */
    body.dark-mode {
        background: linear-gradient(135deg, #1c1c1c, #2a2a2a);
        color: #ddd;
    }

        body.dark-mode .card-login {
            background: rgba(30, 30, 30, 0.85);
            border-color: rgba(255, 255, 255, 0.1);
        }

        body.dark-mode .form-control {
            background: rgba(50, 50, 50, 0.9);
            color: #fff;
            border: 1px solid rgba(255,255,255,0.2);
        }

            body.dark-mode .form-control:focus {
                box-shadow: 0 0 0 0.2rem rgba(255, 183, 77, 0.4);
            }

        body.dark-mode label {
            color: #ddd;
        }

        body.dark-mode .btn-login {
            background: linear-gradient(135deg, #ff9800, #ff5722);
            color: #fff;
        }

        body.dark-mode .alert-danger {
            background-color: rgba(255, 0, 0, 0.2);
            color: #fff;
        }

/* Theme toggle fixed top-right */
#themeToggle {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 9999;
}

/* Background gradient animation */
@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Card base (used by .card-login and login-card wrappers) */
.card-login,
.card-login .card,
.login-card .card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 20px 35px rgba(0,0,0,0.12);
    animation: fadeIn 0.8s ease-in-out;
}

    /* Hover effect on card */
    .card-login:hover {
        transform: translateY(-3px);
        box-shadow: 0 15px 30px rgba(0,0,0,0.2);
    }

/* Form controls */
.form-control {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 10px;
    padding: 0.7rem 0.9rem;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Primary button */
.btn-login {
    background: linear-gradient(135deg, #ff9800, #ff5722);
    border: none;
    border-radius: 30px;
    color: #fff;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

    .btn-login:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 25px rgba(255, 87, 34, 0.5);
    }

    .btn-login:active {
        transform: translateY(1px);
        box-shadow: 0 6px 15px rgba(255, 87, 34, 0.4);
    }

#btnSpinner {
    margin-left: 10px;
    vertical-align: middle;
}

#btnText {
    transition: all 0.2s ease;
}

/* Logo */
.login-logo {
    width: 160px;
    margin-bottom: 1rem;
    animation: pulseLogo 3s ease-in-out infinite;
}

    .login-logo:hover {
        transform: scale(1.05);
        box-shadow: 0 0 20px 5px rgba(255,200,100,0.6);
    }

/* Floating icons - positioned over left column (decorative) */
.floating-icons {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

    .floating-icons img {
        position: absolute;
        top: 20%;
        width: 40px;
        opacity: 0.85;
        animation: floatRotate 14s linear infinite, twinkle 2s ease-in-out infinite;
        transform: translate3d(0,0,0);
    }

@keyframes floatRotate {
    0% {
        transform: translateY(0vh) translateX(0) rotate(0deg);
        opacity: 0.6;
    }

    25% {
        transform: translateY(6vh) translateX(10px) rotate(90deg);
        opacity: 1;
    }

    50% {
        transform: translateY(12vh) translateX(-10px) rotate(180deg);
        opacity: 0.9;
    }

    75% {
        transform: translateY(6vh) translateX(5px) rotate(270deg);
        opacity: 1;
    }

    100% {
        transform: translateY(0vh) translateX(0) rotate(360deg);
        opacity: 0.6;
    }
}

/* Password eye */
.password-wrapper {
    position: relative;
}

    .password-wrapper input {
        padding-right: 3rem;
    }

.password-eye {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
    z-index: 5;
}

    .password-eye.active {
        transform: translateY(-50%) rotateY(180deg);
    }

/* Animations */
@keyframes pulseLogo {
    0%,100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%,100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-6px);
    }

    40% {
        transform: translateX(6px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }
}

.login-error {
    animation: shake 0.4s;
    border: 1px solid rgba(255,0,0,0.4);
}

/* Carousel / left column image fill */
.carousel-image {
    background-size: cover;
    background-position: center;
    width: 100%;
    height: 100%;
    min-height: 420px;
}

/* Ensure carousel controls contrast */
.carousel-control-prev-icon,
.carousel-control-next-icon {
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35));
}

/* Gentle twinkle/fade-in */
@keyframes twinkle {
    0%,100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

/* Spinner alignment */
#btnSpinner {
    vertical-align: middle;
}

/* Accessibility / Focus transitions */
input[type="text"], input[type="password"], .form-select {
    transition: box-shadow .08s ease, border-color .08s ease;
}

/* =========================
   Mobile Friendly Tweaks
   ========================= */

/* General mobile layout adjustments and hiding decorative left column */
@media (max-width: 767.98px) {

    /* Avoid global body flex-centering causing overflow on small screens */
    body {
        display: block;
        align-items: initial;
        justify-content: initial;
        min-height: 100vh;
    }

    /* login-page container stacking and padding */
    .login-page {
        display: block;
        padding-top: 18px;
        padding-bottom: 18px;
        box-sizing: border-box;
        min-height: 100vh;
    }

    /* Make login card full-width with small horizontal margins */
    .login-card {
        max-width: none !important;
        width: calc(100% - 24px) !important;
        margin: 0 auto;
        padding: 10px;
    }

        /* Card & inner content spacing */
        .card-login, .card-login .card, .login-card .card {
            border-radius: 12px;
            padding: 12px;
        }

    .card-body {
        padding: 12px;
    }

    /* Hide left-column visuals on mobile for clarity & performance */
    #loginCarousel {
        display: none !important;
        height: 0 !important;
        visibility: hidden !important;
    }

    .floating-icons {
        display: none !important;
    }

    /* Logo scaling */
    .login-logo {
        width: min(48%, 140px);
        max-width: 140px;
        height: auto;
        margin-bottom: 0.75rem;
    }

    /* Inputs & buttons full width and touch-friendly */
    .form-control, .btn-login {
        width: 100%;
        font-size: 1rem;
    }

    .btn-login {
        padding: 0.7rem 1rem;
        border-radius: 10px;
    }

    /* Password eye adjustments */
    .password-wrapper input {
        padding-right: 2.6rem;
    }

    .password-eye {
        right: 10px;
        font-size: 1.1rem;
    }

    /* Reduce animation intensity for performance */
    .login-logo {
        animation-duration: 4.5s;
    }

    .floating-icons img {
        animation-duration: 20s;
    }

    /* Theme toggle sizing & position tweak */
    #themeToggle {
        top: 10px;
        right: 10px;
        padding: .35rem .5rem;
    }

    /* Rendering/performance hints */
    html, body {
        -webkit-backface-visibility: hidden;
        -webkit-transform: translateZ(0);
    }

    /* Ensure keyboard-friendly scroll when inputs focus */
    input:focus, textarea:focus {
        scroll-margin-top: 12vh;
    }
}

/* Extra small viewport adjustments */
@media (max-width: 400px) {
    .login-logo {
        width: min(46%, 120px);
    }

    .btn-login {
        font-size: 0.96rem;
        padding: 0.62rem 0.9rem;
    }
}

/* Safety CSS to hide carousel and floating icons when screen < 768 (in addition to markup utilities) */
@media (max-width: 767.98px) {
    #loginCarousel {
        display: none !important;
    }

    .floating-icons {
        display: none !important;
    }
}

/* End of login.css */
/* Make the left slide/carousel occupy the full left area on desktop */
/* Remove left-column gap for desktop (place at end of login.css) */
/* Force carousel images to stretch and cover the entire left column (desktop) */
@media (min-width: 768px) {
    /* make sure parent chain fills the viewport */
    html, body, .login-page, .login-page .row.w-100, .login-page .col-md-7 {
        height: 100vh !important;
        min-height: 100vh !important;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

        /* Remove any gutter/padding that could create a gap */
        .login-page .row.w-100,
        .login-page .col-md-7 {
            --bs-gutter-x: 0 !important;
            padding-left: 0 !important;
            padding-right: 0 !important;
        }

    /* Ensure carousel fills the column */
    #loginCarousel,
    #loginCarousel .carousel-inner,
    #loginCarousel .carousel-item {
        height: 100vh !important;
        min-height: 100vh !important;
        width: 100% !important;
        margin: 0;
        padding: 0;
    }

        /* Background-image container: force cover and centering */
        #loginCarousel .carousel-image {
            height: 100vh !important;
            min-height: 100vh !important;
            width: 100% !important;
            background-size: cover !important;
            background-position: center center !important;
            background-repeat: no-repeat !important;
            display: block;
        }

            /* If you switch to <img> elements, make them fill using object-fit */
            #loginCarousel .carousel-image img,
            .carousel-img-full {
                display: block;
                width: 100% !important;
                height: 100vh !important;
                object-fit: cover !important;
                object-position: center center !important;
            }

    /* If a small border or gap still appears, this forces the left column to touch the viewport edge */
    .login-page.container-fluid,
    .login-page > .container,
    .login-page > .container-fluid {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

