@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* Auth styles - typography, colors and layout to match provided design */
:root {
    --bg: #f6f2ec;
    --card-bg: #ffffff;
    --accent: #b84b1b; /* button and heading color */
    --muted: #8a8a8a;
    --input-border: #f3d9ce;
    --social-bg: #f7efe8;
    --text: #4b4b4b;
}

/* Base */
html, body, #app {
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
    overflow-y: auto;
    font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
    color: var(--text);
    font-size: 16px;
    line-height: 1.4;
}

/* Layout */
.auth-page {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 14px;
    box-sizing: border-box;
}

.auth-back-btn {
    position: fixed;
    top: 16px;
    left: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--card-bg, #fff);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    color: var(--text-primary, #333);
    font-size: 1.1rem;
    text-decoration: none;
    z-index: 100;
    transition: box-shadow 0.2s, transform 0.15s;
}

.auth-back-btn:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
    transform: translateX(-2px);
    color: var(--primary, #b34700);
}

.auth-card {
    width: 100%;
    max-width: 520px; /* sane max-width for desktop and mobile */
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.75rem 1.5rem;
    box-shadow: 0 14px 30px rgba(21,21,21,0.08);
    margin: 0 auto;
    box-sizing: border-box;
}

/* logo */
.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.auth-logo-img {
    width: 140px; /* matched to web portal size estimation */
    height: auto;
    object-fit: contain;
}

/* Headings */
.auth-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent);
    text-align: center;
    margin: 0.35rem 0 0.25rem;
}

.auth-subtitle {
    font-size: 13px;
    color: var(--muted);
    text-align: center;
    margin-bottom: 1rem;
}

/* Form */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 13px;
    margin-bottom: 0.35rem;
    color: #333;
}

/* Base input */
.form-input,
input.form-input,
.signup-input {
    width: 100%;
    min-height: 48px;
    padding: 0.60rem 0.90rem;
    border-radius: 8px;
    border: 1px solid #f3d9ce; /* matching --input-border variable */
    background: var(--bg-white, #fff);
    box-sizing: border-box;
    font-size: 15px;
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

    .form-input:focus,
    input.form-input:focus {
        border-color: var(--accent);
        box-shadow: 0 0 0 3px rgba(184,75,27,0.1);
        outline: none;
    }

/* Error Message Styling */
.error-message {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    background-color: transparent;
    color: #4b4b4b;
    font-size: 13px;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.error-icon {
    color: #4b4b4b;
    font-size: 16px;
    flex-shrink: 0;
}

.error-text {
    flex: 1;
}

/* IMPORTANT:
   We keep this class in markup, but it must not apply layout/padding globally
   because you use it on BOTH <i> and <input>. */
.with-left-icon {
    /* intentionally empty */
}

/* ICON WRAPPERS (EMAIL/PASSWORD) - uses your markup */
.email-wrapper,
.password-wrapper {
    position: relative;
    width: 100%;
}

    /* LEFT ICON (<i>) */
    .email-wrapper > i.with-left-icon,
    .password-wrapper > i.with-left-icon {
        position: absolute;
        left: 16px;
        top: 50%;
        transform: translateY(-50%);
        width: 18px;
        height: 18px;
        line-height: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        color: rgba(0,0,0,0.55);
        pointer-events: none;
        z-index: 2;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* INPUT PADDING to make room for LEFT ICON + RIGHT BUTTON (password) */
    .email-wrapper .form-input,
    .email-wrapper input.form-input {
        padding-left: 48px;
    }

    .password-wrapper .form-input,
    .password-wrapper input.form-input {
        padding-left: 48px;
        padding-right: 48px;
    }

/* PASSWORD TOGGLE (EYE) */
.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: rgba(0,0,0,0.55);
    border-radius: 8px;
    cursor: pointer;
    z-index: 3;
}

    /* If Bootstrap .btn styles leak in, neutralize them */
    .password-toggle.btn {
        box-shadow: none !important;
    }

    .password-toggle:hover {
        background: rgba(0,0,0,0.04);
        color: rgba(0,0,0,0.70);
    }

    .password-toggle:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(184,75,27,0.12);
    }

    .password-toggle i {
        pointer-events: none;
        font-size: 16px;
    }

/* Options row */
.auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 13px;
}

.forgot-password {
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
}

/* Primary button */
.btn-login,
.btn.btn-primary {
    display: block;
    width: 100%;
    padding: 0.70rem 1rem;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    border: none;
    font-size: 14px;
    font-weight: 600;
}

    .btn-login:hover,
    .btn.btn-primary:hover {
        filter: brightness(0.98);
    }

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #bfbfbf;
    margin: 1rem 0;
    font-size: 12px;
}

    .auth-divider::before,
    .auth-divider::after {
        content: "";
        flex: 1 1 auto;
        height: 1px;
        background: #ecd9cc;
    }

/* Social buttons */
.social-login .btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.85rem;
    border-radius: 8px;
    border: 1px solid #ecd9cc;
    background: var(--social-bg);
    color: #2f2f2f;
    font-size: 14px;
}

    .social-login .btn i {
        font-size: 16px;
    }

    .social-login .btn + .btn {
        margin-top: 0.6rem;
    }

.auth-footer {
    text-align: center;
    margin-top: 1rem;
    font-size: 13px;
    color: var(--muted);
}

    .auth-footer a {
        color: var(--accent);
        font-weight: 600;
        text-decoration: none;
    }

/* small screens */
@media (max-width: 992px) {
    .auth-card {
        max-width: 480px;
        padding: 1.35rem 1.10rem;
    }
}

/* Verify email page */
.verify-page {
    width: 100%;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.verify-card {
    width: 100%;
    max-width: 520px;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem 1.75rem;
    box-shadow: 0 14px 30px rgba(21,21,21,0.08);
    text-align: center;
}

@media (max-width: 992px) {
    .verify-card {
        max-width: 480px;
        padding: 1.35rem 1.10rem;
    }
}
