﻿/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Roboto, sans-serif;
}

html {
    overflow-y: scroll;
}

body {
    background-color: #2a2a2a;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #f0f0f0;
    font-size: 14px;
    line-height: 21px;
}

body.theme-light {
    background-color: #f2f3fa;
    color: #1d1f45;
}

body.theme-light .login-card {
    background-color: #fff;
    border-color: #f2f3fa;
}

body.theme-light .login-title,
body.theme-light .login-subtitle {
    color: #1d1f45 !important;
}

body.theme-light .input-icon {
    color: #3d3d4e;
    border-color: #ced4da;
}

body.theme-light .input-field {
    border-color: #ced4da;
    background-color: #fff;
    color: #3d3d4e;
}

body.theme-light .input-field::placeholder { color: #757575; }
body.theme-light .loading-container { background-color: #f2f3fa; }
body.theme-light .spinner { border-color: #d7d7d7; border-top-color: #717171; }

body.login-failure-open { overflow: hidden; }

.login-failure-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(0, 0, 0, 0.5);
}

.login-failure-modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    pointer-events: none;
}

.login-failure-alert {
    width: min(500px, calc(100% - 32px));
    min-height: 58px;
    margin-top: 28px;
    padding: 12px 16px 12px 20px;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 32px;
    align-items: center;
    column-gap: 12px;
    border: 1px solid #ca313f;
    border-radius: 4px;
    background: #f8d7da;
    color: #4f1319;
    box-shadow: 0 9px 18px rgba(0, 0, 0, 0.28);
    font-size: 14.4px;
    line-height: 21.6px;
    text-align: left;
    pointer-events: auto;
}

.login-failure-icon {
    width: 32px;
    height: 32px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-failure-close {
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: #8e6a6d;
    font-size: 30px;
    font-weight: 700;
    line-height: 30px;
    cursor: pointer;
}

.login-failure-close:hover,
.login-failure-close:focus { color: #4f1319; outline: 0; }

.login-failure-backdrop[hidden],
.login-failure-modal[hidden] { display: none !important; }

/* Header Styles */
.header {
    background-color: #00427a;
    height: 57.59375px;
    flex: 0 0 57.59375px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 max(0px, calc((100% - 960px) / 2));
    color: #f0f0f0;
    transition: opacity 0.3s;
}

.logo-container {
    display: flex;
    align-items: center;
    height: 100%;
    flex: 1 1 auto;
    padding-left: 8px;
}

.mistertango-header-logo {
    width: 128px;
    height: 26px;
    display: block;
    background-image: url('/images/mistertango-login-header-reference.png');
    background-size: 306px 56px;
    background-position: -84px -13px;
    background-repeat: no-repeat;
}

.login-nav {
    display: flex;
    align-items: center;
    height: 100%;
    flex: 0 0 102.890625px;
    justify-content: center;
    padding: 0 19.2px;
    cursor: pointer;
    position: relative;
    font-size: 14px;
    line-height: 14px;
}

    .login-nav::before {
        content: '';
        position: absolute;
        left: -32px;
        top: 14px;
        width: 1px;
        height: 30px;
        background: rgba(255, 255, 255, 0.2);
    }

    .login-nav::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 3px;
        background-color: #a3c2e0;
    }

    .login-nav svg {
        margin-right: 8px;
        width: 22px;
        height: 22px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
    }

/* Main Content Styles */
.main-container {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 80px 20px 80px;
}

.login-card {
    background-color: #252525;
    width: 100%;
    max-width: 400px;
    height: 429px;
    padding: 0;
    border-radius: 4px;
    border: 1px solid #171717;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.075);
    text-align: center;
}

.login-title {
    height: 54.4px;
    margin: 28px 0 0;
    padding-top: 1.6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17.6px;
    line-height: 17.6px;
    color: #f0f0f0;
    font-weight: 400;
}

.login-subtitle {
    width: 300.390625px;
    height: 53px;
    margin: 16px auto 0;
    padding: 0 0 32px;
    font-size: 14px;
    color: #f0f0f0 !important;
    line-height: 21px;
    white-space: nowrap;
}

/* Form Styles */
.input-group {
    width: 100%;
    display: flex;
    height: 38.1953125px;
    margin-bottom: 16px;
    border: 0;
    border-radius: 0;
    overflow: visible;
    background-color: transparent;
    transition: border-color 0.2s, box-shadow 0.2s;
}

    .input-group.white-bg {
        background-color: white;
    }

        .input-group.white-bg .input-field,
        .input-group.white-bg .input-icon {
            background-color: white;
        }

    .input-group:focus-within {
        border-color: #171918;
        box-shadow: none;
    }

.input-icon {
    width: 38.796875px;
    height: 38.1953125px;
    flex: 0 0 38.796875px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    border: 1px solid #171717;
    border-radius: 4px 0 0 4px;
    background-color: transparent;
}

.input-icon svg {
    width: 20.796875px;
    height: 20.796875px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.input-field {
    flex-grow: 1;
    width: calc(100% - 37.796875px);
    height: 38.1953125px;
    margin-left: -1px;
    border: 1px solid #171717;
    border-radius: 0 4px 4px 0;
    padding: 8.6px 12px 7.6px;
    font-size: 14px;
    line-height: 21px;
    background-color: #363636;
    color: #fff;
    outline: none;
}

.input-field:focus {
    position: relative;
    z-index: 1;
    border: 1px solid #dc7a0b;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 0 3.2px rgba(244, 147, 38, 0.25);
}

    .input-field::placeholder {
        color: #b9b9b9;
    }

/* Buttons */
.btn {
    width: 100%;
    height: 38.1953125px;
    min-height: 38.1953125px;
    padding: 7.6px 12px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 21px;
    font-weight: 400;
    cursor: pointer;
    margin: 16px 0;
    transition: all 0.2s;
    border: 1px solid #f49326;
}

.btn-primary {
    background-color: #f49326;
    color: #1d1f45;
}

    .btn-primary:hover {
        background-color: #f18b11;
    }

.btn-outline {
    background-color: transparent;
    color: #ff9820;
    border: 1px solid #e6994c;
    margin-top: 15px;
}

    .btn-outline:hover {
        background-color: #fffaf5;
    }

.forgot-link {
    display: block;
    width: 300.390625px;
    height: 21px;
    margin: 16px auto;
    color: #f49326;
    text-decoration: none;
    font-size: 14px;
    line-height: 21px;
}

    .forgot-link:hover {
        text-decoration: underline;
    }

/* Loading Spinner */
.loading-container {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #282828;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #555;
    border-top-color: #aaa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* View Management */
#view-confirmation {
    display: none; /* Hidden by default */
}

/* Responsive */
@media (max-width: 480px) {
    .header {
        padding: 0 20px;
    }

    .login-card {
        min-height: 0;
        padding: 44px 24px;
    }

    .login-subtitle { white-space: normal; }

    .main-container { padding-top: 42px; }
    .login-nav { min-width: 96px; }
}

#loginForm {
    width: 300.390625px;
    margin: 0 auto;
    display: block;
}

/* Login confirmation page: copied from the original post-login screen. */
.confirmation-card {
    height: 380.984375px;
}

.confirmation-card .login-subtitle {
    width: 302px;
    height: 74px;
    margin: 16px auto 0;
    padding-bottom: 32px;
    line-height: 21px;
    white-space: normal;
}

#confirmationForm {
    width: 302px;
    margin: 0 auto;
    display: block;
}

#confirmationForm .confirmation-key-icon {
    width: 20.796875px;
    height: 20.796875px;
    fill: currentColor;
    stroke: none;
}

#confirmationForm .input-field[focused] {
    position: relative;
    z-index: 1;
    border: 1px solid #dc7a0b;
    box-shadow: 0 0 0 3.2px rgba(244, 147, 38, 0.25);
}

#confirmationForm .btn-outline {
    margin: 0;
    color: #f49326;
    border-color: #f49326;
    background-color: transparent;
}

#confirmationForm .btn-outline:hover {
    background-color: transparent;
}

@media (max-width: 480px) {
    .confirmation-card {
        height: 380.984375px;
        padding: 0;
    }

    .confirmation-card .login-subtitle,
    #confirmationForm {
        width: min(302px, calc(100% - 48px));
    }
}
