/* =========================================================================
 *  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;
    --danger-color:        #dc3545;
    --success-color:       #198754;
    --shadow-normal:       0 .5rem 1.5rem rgba(0, 0, 0, .08);
    --border-radius:       8px;
}

/* -------------------------------------------------------------------------
 *  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: 15px;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--background-color);
    -webkit-font-smoothing: antialiased;
}

/* -------------------------------------------------------------------------
 *  Split Screen Layout
 * ------------------------------------------------------------------------- */
.login-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* LEFT SIDE */
.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: 4rem 4rem 4rem 5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-wrapper .left-side .greeting {
    font-family: 'Petrona', Georgia, serif;
    font-size: 4rem;
    line-height: 1.1;
    font-weight: 500;
    max-width: 520px;
    letter-spacing: -0.5px;
}

/* RIGHT SIDE */
.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: 3rem 2rem;
    overflow-y: auto;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background-color: var(--background-color);
    border-radius: 16px;
    padding: 2.5rem 2.5rem 1.75rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
}

/* Logo Header */
.login-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
}

.login-header .logo-everymail {
    height: 32px;
    width: auto;
}

.login-header .divider {
    width: 1px;
    height: 24px;
    background-color: #d1cec7;
    margin: 0 1rem;
}

.login-header .app-title {
    font-family: 'Lato', sans-serif;
    font-size: 15px;
    color: var(--text-gray);
    font-weight: 400;
}

/* Form Title */
.form-title {
    font-family: 'Lato', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1.5rem;
}

/* Form Fields */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: var(--text-color);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    font-family: inherit;
    font-size: 15px;
    color: var(--text-color);
    background-color: var(--background-color);
    border: 1px solid #d1cec7;
    border-radius: 6px;
    transition: border-color .15s ease, box-shadow .15s ease;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(55, 113, 127, .15);
}

.form-control::placeholder {
    color: #a8a8a8;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 44px;
    padding: 0 16px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color .15s ease, transform .05s ease;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--primary-hover-color);
}

.btn-primary:active {
    transform: translateY(1px);
}

/* Error Alert */
.alert-danger {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px 14px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 1rem;
}

/* Captcha Box */
.captcha-box {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    margin-bottom: 12px;
    background: repeating-linear-gradient(
        45deg,
        #f4f3f1,
        #f4f3f1 6px,
        #e8e6e3 6px,
        #e8e6e3 12px
    );
    border: 1px solid var(--border-color);
    border-radius: 6px;
    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,.08);
    transform: skew(-3deg);
}

.captcha-box span {
    display: inline-block;
    transform: skew(3deg);
}

/* Logos Transition (TDS -> Everymail) */
.logos-transition {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1rem 0;
}

.logos-transition .logo-tds {
    height: 38px;
    width: auto;
}

.logos-transition .arrow {
    color: var(--text-gray);
    font-size: 22px;
    line-height: 1;
}

.logos-transition .logo-everymail {
    height: 32px;
    width: auto;
}

/* -------------------------------------------------------------------------
 *  Download Card (Stage 2)
 * ------------------------------------------------------------------------- */
.download-card {
    text-align: center;
}

.app-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.5rem 0;
    padding: 1rem;
    background-color: #faf9f7;
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.app-preview-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(210, 46, 255, 0.15));
}

.download-card .message {
    font-size: 15px;
    color: var(--text-gray);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    text-align: left;
}

.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: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    margin-top: 0.5rem;
}

.download-card .message .version-info strong {
    color: #ffffff;
}

/* Progress bar */
.download-card .progress-wrap {
    width: 100%;
    height: 10px;
    background-color: #e8e6e3;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.download-card .progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 10px;
    transition: width .3s ease;
}

.download-card .progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-gray);
    margin-bottom: 1.5rem;
}

.download-card .progress-info .percent {
    font-weight: 700;
    color: var(--primary-color);
}

.download-card .btn-primary {
    margin-bottom: 1rem;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    font-weight: 700;
    text-decoration: none;
}

.download-card .btn-primary:hover {
    background: linear-gradient(90deg, var(--primary-hover-color), #b825e0);
}

.download-card .note {
    font-size: 12px;
    color: #a8a8a8;
    margin-top: 0.5rem;
}

.download-card .note span {
    font-weight: 700;
    color: var(--accent-color);
}

/* -------------------------------------------------------------------------
 *  Responsive
 * ------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .login-wrapper {
        flex-direction: column;
    }

    .login-wrapper .left-side {
        flex: 0 0 auto;
        min-height: 200px;
        padding: 2rem;
        background-size: 80% auto;
        background-position: bottom right;
    }

    .login-wrapper .left-side .greeting {
        font-size: 2.25rem;
        max-width: 100%;
    }

    .login-wrapper .right-side {
        flex: 1;
        padding: 2rem 1.25rem;
    }

    .login-card {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .login-wrapper .left-side {
        min-height: 160px;
        padding: 1.5rem;
    }

    .login-wrapper .left-side .greeting {
        font-size: 1.75rem;
    }

    .login-card {
        padding: 1.5rem 1rem;
        box-shadow: none;
        border: none;
    }
}