@tailwind base;
@tailwind components;
@tailwind utilities;

/* Base Styles */
:root {
    /* Brighter green color palette based on the logo */
    --lime-primary: #818A2D;
    --lime-dark: #6A7225;
    --lime-darker: #575E1E;
    --lime-light: #9CA638;
    --lime-lighter: #B8C24C;
    --lime-lightest: #D8E0A8;
    --text-white: #ffffff;
    --text-gray: #9CA3AF;
    --bg-white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    overflow: auto;
}

#liftware_main_body {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Left side branding section.
   Width and height are deliberately NOT set here: the 50/50 split is driven by
   the `md:w-1/2` utility in auth/login.blade.php, so it always flips at the same
   breakpoint as the `md:flex-row` that stacks the two panels. Setting a hard
   `width: 50%` here made the two disagree between `md` and this file's own
   `max-width` queries, leaving both panels half-width but stacked. */
.bg-lime-primary {
    background-color: var(--lime-primary);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 0;
    /* `overflow: hidden` switches this item's `min-height: auto` off, so when the
       panels stack the flex container is free to squash it below its own content
       and clip the logo off the top. Opt out of shrinking instead. */
    flex-shrink: 0;
}

/* Mixed geometric patterns */
.shape-pattern {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.shape-pattern .shape {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 40s ease-in-out;
}

/* Hexagons */
.shape-pattern .hex-1,
.shape-pattern .hex-2,
.shape-pattern .hex-3,
.shape-pattern .hex-4,
.shape-pattern .hex-5,
.shape-pattern .hex-6,
.shape-pattern .hex-7,
.shape-pattern .hex-8,
.shape-pattern .hex-9,
.shape-pattern .hex-10 {
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

/* Circles */
.shape-pattern .circle-1,
.shape-pattern .circle-2,
.shape-pattern .circle-3,
.shape-pattern .circle-4,
.shape-pattern .circle-5 {
    border-radius: 50%;
}

/* Squares/diamonds */
.shape-pattern .square-1 {
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.shape-pattern .square-2 {
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
    transform: rotate(10deg);
}

.shape-pattern .square-3 {
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    transform: rotate(45deg);
}

.shape-pattern .square-4 {
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    transform: rotate(45deg);
}

/* Specific shape styling and positioning - Desktop (default) */
.shape-pattern .hex-1 {
    width: 80px;
    height: 80px;
    top: 5%;
    left: 5%;
    background-color: var(--lime-light);
    opacity: 0.12;
    animation: float 20s infinite ease-in-out;
}

.shape-pattern .hex-2 {
    width: 160px;
    height: 160px;
    top: 15%;
    right: 10%;
    background-color: var(--lime-lighter);
    opacity: 0.07;
    animation: float 25s infinite ease-in-out reverse;
}

.shape-pattern .hex-3 {
    width: 70px;
    height: 70px;
    top: 30%;
    left: 20%;
    background-color: var(--lime-lighter);
    opacity: 0.09;
    animation: float 22s infinite ease-in-out;
}

.shape-pattern .hex-4 {
    width: 120px;
    height: 120px;
    top: 10%;
    left: 40%;
    background-color: var(--lime-light);
    opacity: 0.05;
    animation: float 28s infinite ease-in-out reverse;
}

.shape-pattern .hex-5 {
    width: 90px;
    height: 90px;
    bottom: 8%;
    right: 18%;
    background-color: var(--lime-lighter);
    opacity: 0.08;
    animation: float 23s infinite ease-in-out;
}

.shape-pattern .hex-6 {
    width: 110px;
    height: 110px;
    bottom: 15%;
    right: 5%;
    background-color: var(--lime-light);
    opacity: 0.07;
    animation: float 26s infinite ease-in-out reverse;
}

.shape-pattern .hex-7 {
    width: 65px;
    height: 65px;
    bottom: 12%;
    left: 10%;
    background-color: var(--lime-lighter);
    opacity: 0.1;
    animation: float 24s infinite ease-in-out;
}

.shape-pattern .hex-8 {
    width: 50px;
    height: 50px;
    top: 25%;
    left: 15%;
    background-color: var(--lime-light);
    opacity: 0.08;
    animation: float 21s infinite ease-in-out reverse;
}

.shape-pattern .hex-9 {
    width: 90px;
    height: 90px;
    bottom: 30%;
    left: 25%;
    background-color: var(--lime-light);
    opacity: 0.06;
    animation: float 27s infinite ease-in-out;
}

.shape-pattern .hex-10 {
    width: 100px;
    height: 100px;
    top: 50%;
    left: 10%;
    background-color: var(--lime-light);
    opacity: 0.06;
    animation: float 30s infinite ease-in-out;
}

/* Circle shapes */
.shape-pattern .circle-1 {
    width: 90px;
    height: 90px;
    top: 35%;
    right: 15%;
    background-color: var(--lime-lightest);
    opacity: 0.08;
    animation: floatCircle 24s infinite ease-in-out;
}

.shape-pattern .circle-2 {
    width: 65px;
    height: 65px;
    bottom: 35%;
    left: 5%;
    background-color: var(--lime-light);
    opacity: 0.07;
    animation: floatCircle 20s infinite ease-in-out reverse;
}

.shape-pattern .circle-3 {
    width: 45px;
    height: 45px;
    top: 20%;
    right: 35%;
    background-color: var(--lime-lighter);
    opacity: 0.09;
    animation: floatCircle 18s infinite ease-in-out;
}

.shape-pattern .circle-4 {
    width: 120px;
    height: 120px;
    bottom: 15%;
    left: 35%;
    background-color: var(--lime-lightest);
    opacity: 0.04;
    animation: floatCircle 30s infinite ease-in-out reverse;
}

.shape-pattern .circle-5 {
    width: 80px;
    height: 80px;
    top: 70%;
    left: 15%;
    background-color: var(--lime-lightest);
    opacity: 0.05;
    animation: floatCircle 26s infinite ease-in-out reverse;
}

/* Square/diamond shapes */
.shape-pattern .square-1 {
    width: 80px;
    height: 80px;
    bottom: 25%;
    right: 30%;
    background-color: var(--lime-lightest);
    opacity: 0.07;
    animation: rotate 28s infinite linear;
}

.shape-pattern .square-2 {
    width: 60px;
    height: 60px;
    top: 60%;
    left: 25%;
    background-color: var(--lime-light);
    opacity: 0.06;
    animation: rotate 22s infinite linear reverse;
}

.shape-pattern .square-3 {
    width: 70px;
    height: 70px;
    top: 45%;
    right: 10%;
    background-color: var(--lime-lighter);
    opacity: 0.05;
    animation: rotate 25s infinite linear;
}

.shape-pattern .square-4 {
    width: 50px;
    height: 50px;
    top: 20%;
    left: 30%;
    background-color: var(--lime-lighter);
    opacity: 0.07;
    animation: rotate 20s infinite linear;
}

/* Animation keyframes */
@keyframes float {
    0% { transform: translateY(0) translateX(0); }
    25% { transform: translateY(-10px) translateX(5px); }
    50% { transform: translateY(0) translateX(10px); }
    75% { transform: translateY(10px) translateX(5px); }
    100% { transform: translateY(0) translateX(0); }
}

@keyframes floatCircle {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-15px) scale(1.05); }
    100% { transform: translateY(0) scale(1); }
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Corporate logo styling */
.corporate-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
    margin: 0 auto 40px auto;
    filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.15));
}

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

/* Mission statement styling */
.mission-statement {
    position: relative;
    z-index: 3;
    padding: 0 2.5rem;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.mission-statement p {
    color: var(--lime-lightest);
    font-size: 1.25rem;
    line-height: 1.5;
    font-weight: 800;
}

/* Right side form section — width comes from `md:w-1/2` in the blade, see above. */
.form-section {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-white);
    flex-shrink: 0;
}

/* Form container */
.form-container {
    width: 100%;
    max-width: 600px; /* Wider form */
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
}

/* Heading */
.heading {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--lime-primary);
    margin-bottom: 2.5rem;
    text-align: center;
}

/* Form */
form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Form elements */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: #4B5563;
}

.input-with-icon {
    position: relative;
    width: 100%;
}

.input-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 16px;
    width: 20px;
    height: 20px;
    color: #9CA3AF;
    z-index: 2;
}

.input-icon svg {
    width: 20px;
    height: 20px;
}

.form-input {
    height: 56px;
    padding: 0 16px 0 48px;
    width: 100%;
    border: none; /* Remove all borders */
    border-bottom: 2px solid #E5E7EB; /* Bottom line only */
    font-size: 0.95rem;
    color: #4B5563;
    background-color: transparent;
    transition: all 0.2s ease;
}

.form-input::placeholder {
    color: #9CA3AF;
}

.form-input:focus {
    outline: none;
    border-bottom-color: var(--lime-primary);
    box-shadow: none; /* Remove shadow on focus */
}

.input-error {
    border-bottom-color: #EF4444;
}

.error-message {
    color: #EF4444;
    font-size: 0.875rem;
    margin-top: 4px;
}

/* Password header with forgot link */
.password-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.forgot-link {
    font-size: 0.875rem;
    color: var(--lime-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: var(--lime-dark);
    text-decoration: underline;
}

/* Login button */
.login-button {
    height: 56px;
    background-color: var(--lime-primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-md);
}

.login-button:hover {
    background-color: var(--lime-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.login-button:active {
    transform: translateY(0);
    box-shadow: var(--shadow);
}

/* Divider */
.divider {
    position: relative;
    display: flex;
    align-items: center;
    margin: 16px 0;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: #E5E7EB;
}

.divider span {
    padding: 0 16px;
    color: #9CA3AF;
    font-size: 0.875rem;
    background-color: white;
}

/* Microsoft login button */
.ms-login-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    background-color: white;
    color: #4B5563;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}

.ms-login-button:hover {
    background-color: #F9FAFB;
    box-shadow: var(--shadow);
}

/* Microsoft logo styling */
.microsoft-logo {
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0;
    margin-right: 2px;
    margin-top: -1px;
}

/* Mobile Adjustments (Portrait) */
@media (max-width: 768px) and (orientation: portrait) {
    #liftware_main_body {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .bg-lime-primary {
        min-height: 40vh;
    }

    .corporate-logo {
        width: 200px;
        margin: 0 auto 20px auto;
    }

    .mission-statement {
        padding: 0 1rem;
        max-width: 90%;
        margin: 0 auto;
    }

    .mission-statement p {
        font-size: 0.85rem;
        line-height: 1.3;
    }

    .form-container {
        padding: 1.5rem;
        margin: 2rem auto;
        max-width: 100%;
    }

    .heading {
        font-size: 1.5rem;
        margin-bottom: 1.25rem;
    }

    .form-input {
        height: 44px;
        padding: 0 12px 0 40px;
        font-size: 0.9rem;
    }

    .input-icon {
        left: 12px;
        width: 18px;
        height: 18px;
    }

    .input-icon svg {
        width: 18px;
        height: 18px;
    }

    .login-button {
        height: 44px;
        font-size: 1rem;
    }

    .ms-login-button {
        height: 40px;
        font-size: 0.9rem;
    }

    .divider {
        margin: 12px 0;
    }

    .shape-pattern {
        opacity: 0.5;
    }
}

/* Mobile Adjustments (Landscape) */
@media (max-width: 932px) and (orientation: landscape) {
    #liftware_main_body {
        flex-direction: row;
        height: 100vh;
    }

    .bg-lime-primary {
        padding: 1rem 0;
    }

    .corporate-logo {
        width: 150px;
        margin: 0 auto 15px auto;
    }

    .mission-statement {
        padding: 0 1rem;
        max-width: 90%;
        margin: 0 auto;
    }

    .mission-statement p {
        font-size: 0.8rem;
        line-height: 1.2;
    }

    .form-container {
        padding: 1rem;
        max-width: 100%;
    }

    .heading {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    .form-input {
        height: 40px;
        padding: 0 12px 0 40px;
        font-size: 0.85rem;
    }

    .input-icon {
        left: 12px;
        width: 16px;
        height: 16px;
    }

    .input-icon svg {
        width: 16px;
        height: 16px;
    }

    .login-button {
        height: 40px;
        font-size: 0.95rem;
    }

    .ms-login-button {
        height: 36px;
        font-size: 0.85rem;
    }

    .divider {
        margin: 8px 0;
    }

    .shape-pattern {
        opacity: 0.3;
    }
}

/* Fine-tuning for smaller mobile landscape heights */
@media (max-width: 932px) and (orientation: landscape) and (max-height: 430px) {
    .corporate-logo {
        width: 120px;
        margin: 0 auto 10px auto;
    }

    .mission-statement {
        margin: 0 auto;
    }

    .mission-statement p {
        font-size: 0.75rem;
    }

    .form-container {
        padding: 0.5rem;
    }

    .heading {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }

    .form-input {
        height: 36px;
        font-size: 0.8rem;
    }

    .login-button {
        height: 36px;
        font-size: 0.9rem;
    }

    .ms-login-button {
        height: 32px;
        font-size: 0.8rem;
    }

    .divider {
        margin: 6px 0;
    }
}
