/* IFM Login Page Styling - Shadcn/ui Inspired */

:root {
    /* Shadcn/ui Base Variables - HSL Format */
    --background: 0 0% 98%;
    --foreground: 220 13% 18%;

    --card: 0 0% 100%;
    --card-foreground: 220 13% 18%;

    --popover: 0 0% 100%;
    --popover-foreground: 220 13% 18%;

    /* Brand Primary from Frontend config */
    --primary: 285 56% 45%;
    --primary-foreground: 0 0% 100%;

    --secondary: 220 14% 96%;
    --secondary-foreground: 220 13% 18%;

    --muted: 220 14% 96%;
    --muted-foreground: 220 9% 46%;

    --accent: 285 20% 95%;
    --accent-foreground: 285 56% 40%;

    --destructive: 0 84% 60%;
    --destructive-foreground: 0 0% 100%;

    --border: 220 13% 91%;
    --input: 220 13% 91%;
    --ring: 285 56% 45%;
    /* Same as primary usually */

    --radius: 0.5rem;
    /* rounded-md equivalent roughly */

    /* Extra brand gradients */
    --gradient-primary: linear-gradient(135deg, hsl(285 56% 45%), hsl(330 65% 50%));
}

body {
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;

    /* Subtle background mesh gradient similar to modern SaaS landing pages */
    background-image:
        radial-gradient(at 0% 0%, hsla(285, 56%, 45%, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, hsla(330, 65%, 50%, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
}

/*
   ------------------------------------------
   Card UI (Login Box)
   ------------------------------------------
   Matches: rounded-xl border bg-card text-card-foreground shadow
*/
.page-card,
.custom-login-card {
    background-color: hsl(var(--card));
    color: hsl(var(--card-foreground));
    border: 1px solid hsl(var(--border));
    border-radius: 0.75rem;
    /* modern xl radius */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    /* shadow-lg */
    max-width: 400px;
    width: 100%;
    padding: 0 !important;
    overflow: hidden;
    margin: 0 auto;
    /* Center it */
}

/* Override Frappe section padding */
.login-content {
    padding-top: 4vh !important;
    padding-bottom: 4vh !important;
}

/* Header inside card */
.page-card .page-card-head,
.custom-login-card .page-card-head {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    /* Pt Pr Pb Pl */
    border-bottom: none;
    /* Cleaner look without separator */
    background-color: transparent;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Ensure logo container spacing is tight */
.login-logo-container {
    margin-bottom: 0.25rem !important;
}

.page-card .page-card-head h4,
.custom-login-card .page-card-head h4 {
    font-weight: 600;
    letter-spacing: -0.025em;
    font-size: 1.5rem;
    margin: 0 !important;
    /* Managed by flex gap */
}

/* Content inside card */
.page-card .page-card-body,
.custom-login-card .page-card-body {
    padding: 0 1.5rem 1.5rem 1.5rem;
    /* Pt Pr Pb Pl */
}

/* Form Group Spacing - reduce gap */
.form-group {
    margin-bottom: 1rem !important;
}

.form-group:last-child {
    margin-bottom: 0 !important;
}

/*
   ------------------------------------------
   Input Fields
   ------------------------------------------
   Matches: flex h-10 w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50
*/
.form-control {
    display: flex;
    height: 2.5rem;
    /* h-10 */
    width: 100%;
    border-radius: calc(var(--radius) - 2px);
    /* rounded-md if radius is lg */
    border: 1px solid hsl(var(--input));
    background-color: transparent;
    /* bg-background / transparent */
    padding: 0.5rem 0.75rem;
    /* px-3 py-2 */
    font-size: 0.875rem;
    /* text-sm */
    line-height: 1.25rem;
    color: hsl(var(--foreground));
    transition: all 0.15s ease-in-out;
}

.form-control::placeholder {
    color: hsl(var(--muted-foreground));
}

.form-control:focus {
    outline: none;
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
    /* ring-2 ring-ring ring-offset-2 */
}

/* Label adjustments */
.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--foreground));
    margin-bottom: 0.375rem;
    display: block;
}

/* Fix input icons if present (font awesome / lucide) */
.form-group .input-group-prepend .input-group-text,
.form-group .input-group-append .input-group-text {
    background: transparent;
    border-color: hsl(var(--input));
    color: hsl(var(--muted-foreground));
}

/*
   ------------------------------------------
   Buttons
   ------------------------------------------
   Matches: inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-primary text-primary-foreground hover:bg-primary/90
*/
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem;
    font-weight: 500;
    height: 2.5rem;
    /* h-10 */
    padding-left: 1rem;
    padding-right: 1rem;
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
    cursor: pointer;
}

.btn-primary {
    background: var(--gradient-primary) !important;
    /* Using brand gradient preferrably, or just hsl(var(--primary)) */
    /* If strict shadcn: background-color: hsl(var(--primary)); */
    color: hsl(var(--primary-foreground)) !important;
    border: none;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    /* shadow-sm */
}

.btn-primary:hover {
    opacity: 0.9;
    /* hover:bg-primary/90 */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-primary:focus-visible,
.btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}

.btn-default {
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    border: none;
}

.btn-default:hover {
    background-color: hsl(var(--secondary) / 0.8);
    /* secondary/80 */
}

/* Links (Forgot Password etc) */
a {
    color: hsl(var(--primary));
    font-weight: 500;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Footer / Copyright / Powered By */
.footer {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
}

/* Logo Sizing */
.app-logo {
    max-height: 48px;
    width: auto;
    margin-bottom: 0.5rem;
}

/* Remove default frappe shadows/borders if they interfere */
.frappe-card {
    border: none !important;
    box-shadow: none !important;
}

#page-login .page-card-body {
    padding-bottom: 1px !important;
}

#page-login .form-group .field-icon, #page-login .form-group .toggle-password {
    margin-top: 7px !important;
}
