/* =========================================================================
 *  Everymail Desktop App - Stylesheet
 * =========================================================================
 *  Colors: Teal (#37717f) + Purple (#d22eff)
 *  Fonts:  Petrona (headings) + Lato (body)
 * ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Petrona:wght@400;500;600;700&family=Lato:wght@300;400;700&display=swap');

/* -------------------------------------------------------------------------
 *  CSS Variables
 * ------------------------------------------------------------------------- */
:root {
    --primary-color:       #37717f;
    --primary-hover-color: #30626e;
    --accent-color:        #d22eff;
    --background-color:    #ffffff;
    --light-bg:            #e3e9e7;
    --text-color:          #212529;
    --text-gray:           #44585f;
    --text-dark:           #003c4e;
    --border-color:        #d1cec7;
}

/* -------------------------------------------------------------------------
 *  Reset & Base
 * ------------------------------------------------------------------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    width: 100%;
}

body {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--background-color);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

/* -------------------------------------------------------------------------
 *  Split Screen Layout
 * ------------------------------------------------------------------------- */
.login-wrapper {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

/* -------------------------------------------------------------------------
 *  LEFT SIDE — Swirl background + Greeting
 * ------------------------------------------------------------------------- */
.login-wrapper .left-side {
    flex: 1 1 55%;
    background: var(--light-bg) url('img_swirl.webp') bottom center / contain no-repeat;
    color: var(--text-dark);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-wrapper .left-side .greeting {
    font-family: 'Petrona', Georgia, serif;
    font-size: 3.5rem;
    line-height: 1.1;
    font-weight: 500;
    max-width: 520px;
    letter-spacing: -0.5px;
}

/* -------------------------------------------------------------------------
 *  RIGHT SIDE — Card
 * ------------------------------------------------------------------------- */
.login-wrapper .right-side {
    flex: 1 1 45%;
    background-color: var(--background-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow: hidden;
}

.login-card {
    width: 100%;
    max-width: 460px;
    background-color: var(--background-color);
    border-radius: 16px;
    padding: 1.75rem 2rem 1.5rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
}

/* -------------------------------------------------------------------------
 *  Logo Header (everymail | Desktop App)
 * ------------------------------------------------------------------------- */
.login-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.login-header .logo-everymail {
    height: 28px;
    width: auto;
}

.login-header .divider {
    width: 1px;
    height: 22px;
    background-color: #d1cec7;
    margin: 0 0.9rem;
}

.login-header .app-title {
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    color: var(--text-gray);
    font-weight: 400;
}

/* -------------------------------------------------------------------------
 *  Form Title
 * ------------------------------------------------------------------------- */
.form-title {
    font-family: 'Lato', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1rem;
}

/* -------------------------------------------------------------------------
 *  Download Card
 * ------------------------------------------------------------------------- */
.download-card {
    text-align: center;
}

/* App preview image */
.app-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.75rem 0 1rem;
    padding: 0.5rem;
    background-color: #faf9f7;
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.app-preview-img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(210, 46, 255, 0.15));
}

/* Message */
.download-card .message {
    font-size: 13.5px;
    color: var(--text-gray);
    line-height: 1.6;
    margin-bottom: 1.25rem;
    text-align: left;
}

.download-card .message p + p {
    margin-top: 0.6rem;
}

.download-card .message strong {
    color: var(--text-color);
}

.download-card .message .version-info {
    display: inline-block;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    color: #ffffff;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    margin-top: 0.4rem;
}

.download-card .message .version-info strong {
    color: #ffffff;
}

/* -------------------------------------------------------------------------
 *  Button
 * ------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 46px;
    padding: 0 16px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease, transform .05s ease;
}

.btn-primary {
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    color: #ffffff;
}

.btn-primary:hover {
    background: linear-gradient(90deg, var(--primary-hover-color), #b825e0);
}

.btn-primary:active {
    transform: translateY(1px);
}

/* -------------------------------------------------------------------------
 *  Note
 * ------------------------------------------------------------------------- */
.download-card .note {
    font-size: 12px;
    color: #a8a8a8;
    margin-top: 0.85rem;
}

/* -------------------------------------------------------------------------
 *  Captcha Card (Stage 1)
 * ------------------------------------------------------------------------- */
.captcha-card {
    text-align: center;
}

.captcha-card .form-group {
    margin-bottom: 1.25rem;
}

/* Captcha code box */
.captcha-box {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 62px;
    margin-bottom: 14px;
    background: repeating-linear-gradient(
        45deg,
        #f4f3f1,
        #f4f3f1 6px,
        #e8e6e3 6px,
        #e8e6e3 12px
    );
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 8px;
    color: var(--text-dark);
    user-select: none;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.08);
    transform: skew(-3deg);
}

.captcha-box span {
    display: inline-block;
    transform: skew(3deg);
}

/* Captcha input */
.captcha-card .form-control {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    font-family: inherit;
    font-size: 16px;
    letter-spacing: 2px;
    text-align: center;
    color: var(--text-color);
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.captcha-card .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(55, 113, 127, .15);
}

.captcha-card .form-control::placeholder {
    color: #a8a8a8;
    letter-spacing: normal;
}

/* Error alert */
.captcha-card .alert-danger {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px 14px;
    border-radius: 6px;
    font-size: 13.5px;
    margin-bottom: 1rem;
    text-align: left;
}

/* -------------------------------------------------------------------------
 *  Responsive
 * ------------------------------------------------------------------------- */
@media (max-width: 900px) {
    body { overflow: auto; }

    .login-wrapper {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .login-wrapper .left-side {
        flex: 0 0 auto;
        min-height: 160px;
        padding: 1.5rem;
        background-size: 70% auto;
        background-position: bottom right;
    }

    .login-wrapper .left-side .greeting {
        font-size: 1.75rem;
    }

    .login-wrapper .right-side {
        padding: 1.5rem 1rem;
    }

    .login-card {
        padding: 1.5rem 1.25rem;
    }
}

@media (max-width: 480px) {
    .login-wrapper .left-side {
        min-height: 130px;
        padding: 1.25rem;
    }

    .login-wrapper .left-side .greeting {
        font-size: 1.4rem;
    }

    .login-card {
        box-shadow: none;
        border: none;
        padding: 1rem;
    }
}