﻿/* Extracted styles from `Views/Authorise/Login.cshtml` so the page can stay clean.
   Note: In Razor views, `@media` must not appear in markup. In .css files it's fine.
*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', 'Segoe UI', sans-serif;
}

body {
    background-color: #ffffff; /* Page background white */
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-card {
    background: #ffffff;
    width: 380px;
    height: 520px;
    border-radius: 45px;
    /* Soft shadow with a hint of purple depth */
    box-shadow: 0 40px 100px rgba(90, 25, 120, 0.12);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Mobile: make the login-card full-screen */
@media (max-width: 576px) {
    body {
        height: 100dvh;
        overflow: hidden; /* prevent mobile vertical scrollbar */
    }

    .login-card {
        width: 100vw;
        height: 100dvh;
        border-radius: 0;
        box-shadow: none;
        overflow: hidden; /* ensure inner absolute elements can't force scroll */
    }

    .design-bg {
        border-radius: 0 !important;
    }

    /* this one still rounds the bottom-right corner */
    .blue-wave-accent {
        border-radius: 0 !important;
    }

    /* On mobile, place the submit button below the fields */
    form {
        height: auto;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        padding: 170px 28px 24px; /* was 170px 28px 90px */
        overflow: hidden;
    }

    .card-content {
        display: flex;
        flex-direction: column;
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        padding: 0;
        width: 100%;
    }

    /* Mobile: make submit-btn look like a normal Bootstrap button */
    .submit-btn {
        position: static !important;
        inset: auto !important;
        transform: none !important;

        width: 100%;
        height: auto;
        padding: .5rem 1rem;

        border-radius: .375rem;
        font-size: 1rem;
        line-height: 1.5;
        font-weight: 400;

        background: #0d6efd; /* Bootstrap primary */
        border: 1px solid #0d6efd;
        box-shadow: none;

        display: inline-block;
        margin: 14px 0 0;
    }

    .submit-btn:hover {
        transform: none;
        background: #0b5ed7;
        border-color: #0a58ca;
        box-shadow: none;
    }

    .submit-btn:focus {
        outline: 0;
        box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25);
    }

    .submit-btn:disabled {
        opacity: .65;
        cursor: not-allowed;
    }

    /* error message (now placed after submit button in markup) */
    form > .modern-alert {
        margin-top: 12px !important;
    }

    /* Optional: if you still want more breathing room, use 40px instead of 24px */
    /* form { padding: 170px 28px 40px; } */
}

.design-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 45px;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.purple-sweep-main {
    position: absolute;
    top: 0;
    width: 100%;
    height: 35%;
    background: linear-gradient(to right, #6a11cb, #2575fc);
    clip-path: path('M0,0 L380,0 L380,120 C280,180 100,60 0,150 Z');
    z-index: 2;
}

.purple-sweep-shadow {
    position: absolute;
    top: 5px;
    width: 100%;
    height: 37%;
    background: #5a1978;
    opacity: 0.1;
    clip-path: path('M0,0 L380,0 L380,130 C280,190 100,70 0,160 Z');
    z-index: 1;
}

/* --- BLUE BOTTOM (15% Height) --- */
.blue-wave-main {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 15%;
    background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
    clip-path: ellipse(115% 100% at 85% 100%);
    z-index: 2;
}

.blue-wave-accent {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 85%;
    height: 12%;
    background: #00d2ff;
    opacity: 0.2;
    border-radius: 50% 50% 0 0;
    z-index: 1;
}

.login-header-container {
    position: absolute;
    top: 10px; /* Decreased from 50px to move it up */
    left: 0;
    width: 100%;
    padding-top: 25px; /* Reduced padding */
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 15px;
    z-index: 20;
}

.header-logo {
    height: 40px; /* Smaller height as requested */
    width: auto;
}

.login-title {
    color: #fff;
    font-style: italic;
    transform: skewX(-10deg);
    text-decoration: overline #1de9b6 4px;
    font-weight: 800;
}

.card-content {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    transform: translateY(-50%); /* This pulls it perfectly into the middle */
    padding: 0 45px;
    z-index: 10;
    /* Ensure no old margins are pushing it down */
    margin-top: 0;
}

.input-group {
    display: flex;
    align-items: center;
    padding: 24px 0;
}

.icon {
    font-size: 1.2rem;
    color: #cbd5e0;
}

.input-group input {
    border: none;
    outline: none;
    padding-left: 15px;
    font-size: 1.1rem;
    color: #333;
    width: 100%;
    background: transparent;
}

.divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #eee, transparent);
    width: 100%;
}

/* --- THE SUBMIT BUTTON --- */
.submit-btn {
    position: absolute;
    width: 66px;
    height: 66px;
    right: -33px; /* Keeps half the button outside the card */
    top: 50%;
    transform: translateY(-50%);

    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #1de9b6 0%, #15bca1 100%);
    color: white;
    font-size: 32px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(29, 233, 182, 0.4);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Ensure the submit button label comes from markup (no pseudo-content tricks) */
.submit-btn {
    color: #fff;
}

.submit-btn::before,
.submit-btn::after {
    content: none !important;
}

.submit-btn:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 15px 35px rgba(29, 233, 182, 0.6);
}

/* Mobile: make submit-btn look like a normal Bootstrap button */
@media (max-width: 576px) {
    .submit-btn {
        position: static !important;
        inset: auto !important;
        transform: none !important;

        width: 100%;
        height: auto;
        padding: .5rem 1rem;

        border-radius: .375rem;
        font-size: 1rem;
        line-height: 1.5;
        font-weight: 400;

        background: #0d6efd;
        border: 1px solid #0d6efd;
        box-shadow: none;

        display: inline-block;
        margin: 14px 0 0;

        /* show "Login" text on mobile */
        color: #fff;
    }

    .submit-btn::after {
        content: none;
    }

    /* space between Password field area and the submit button */
    .card-content > span.text-danger:last-of-type {
        margin-bottom: 60px;
        display: block;
    }

    .purple-sweep-main,
    .purple-sweep-shadow {
        
        border-radius: 0 !important;
    }
}

.top-left-img {
    position: absolute;
    top: 20px; /* Distance from top */
    right: 25px; /* Distance from right */
    width: 60px; /* Adjust size as needed */
    height: auto;
    z-index: 15; /* Higher than the background sweeps (z-index 2) */
    opacity: 0.9; /* Optional: makes it blend better */
    pointer-events: none; /* Prevents the image from interfering with clicks */
}

/* Mobile specific adjustments */
@media (max-width: 576px) {
    .purple-sweep-main {
        height: 22%; /* was 35% */
    }

    .purple-sweep-shadow {
        height: 24%; /* was 37% */
        top: 3px; /* was 5px */
    }

    .purple-sweep-main,
    .purple-sweep-shadow {
        clip-path: none !important;

        -webkit-mask-image: url("/images/purple-sweep-mask.svg");
        mask-image: url("/images/purple-sweep-mask.svg");
        -webkit-mask-repeat: no-repeat;
        mask-repeat: no-repeat;
        -webkit-mask-size: 100% 100%;
        mask-size: 100% 100%;
        -webkit-mask-position: top left;
        mask-position: top left;
    }

    .submit-btn,
    .submit-btn:hover,
    .submit-btn:focus,
    .submit-btn:focus-visible,
    .submit-btn:active {
        box-shadow: none !important;
        outline: none !important;
        filter: none !important;
    }

    /* prevents the gray tap highlight on iOS/Android webviews */
    .submit-btn {
        -webkit-tap-highlight-color: transparent;
    }
}

.login-alert {
    margin: 0 0 12px;
}
