:root {
    --primary-orange: #d13000;
    --primary-orange-hover: #b32900;
    --bg-color: #e5e9f0;
    --text-color: #1a1a1a;
    --border-color: #d1d5db;
    --blue-info: #b3cdef;
    --blue-info-border: #91b3e0;
    --blue-block-bg: #5a77a9;
    --white: #ffffff;
    --purple-text: #2c1a40;
    --focus-ring: #ad6dff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
}

/* Header */
.top-nav {
    background-color: var(--white);
    padding: 15px 40px;
    border-bottom: 1px solid #c9c9c9;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: max(0px, calc((100vw - 1100px) / 2));
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 30px;
    width: auto;
    object-fit: contain;
}


.logo-tagline {
    font-size: 11px;
    color: var(--purple-text);
    line-height: 1.1;
    font-weight: 600;
    border-left: 1px solid #d1d5db;
    padding-left: 15px;
}

/* Main Layout */
.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    min-height: calc(100vh - 67px);
}

.wrapper {
    width: 100%;
    max-width: 950px;
}

.wrapper.hidden {
    display: none !important;
}

#tan-wrapper,
#confirm-wrapper {
    max-width: 700px;
    align-self: flex-start;
    /* Left-aligned, not centered */
}


h2 {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 25px;
}

/* Card Containers */
.form-container {
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    width: 100%;
}

.split-view {
    display: flex;
    min-height: 480px;
}

.simple-view {
    padding: 30px;
}

/* Split View Image Side */
.side-blue-block {
    width: 50%;
    padding: 15px 0 15px 15px;
    /* Creates the gap between image and card edge */
    align-self: stretch;
    background-color: var(--white);
}

.side-blue-block-inner {
    width: 100%;
    height: 100%;
    background-image: url('https://id.handel.mobile.de/images/default-marketing-image-de.png');
    background-size: cover;
    background-position: center;
    border-radius: 8px;
}

.image-text {
    position: relative;
    z-index: 1;
}

.logo-small {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 18px;
}

.image-text h1 {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 18px;
}

.image-overlay-link {
    position: relative;
    z-index: 1;
    margin-top: auto;
    /* Push to bottom */
}

.more-info-link {
    color: var(--white);
    text-decoration: underline;
    font-size: 14px;
}

/* Form Panel */
.form-panel {
    width: 50%;
    padding: 40px 50px;
}

.instruction {
    font-size: 15px;
    margin-bottom: 30px;
    line-height: 1.4;
}

.step {
    display: flex;
    flex-direction: column;
}

.step.hidden {
    display: none !important;
}

/* Inputs */
.input-group {
    margin-bottom: 20px;
    position: relative;
}

label {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-color);
}

.custom-checkbox-label {
    display: flex;
    align-items: center;
    gap: 5px;
}

.info-icon-svg {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px;
    margin-left: 5px;
    opacity: 0.6;
}

/* Tooltips */
.tooltip-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.tooltip-content {
    visibility: hidden;
    position: absolute;
    bottom: 100%;
    /* Position above the icon */
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--white);
    color: var(--text-color);
    text-align: left;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 400;
    /* Reset font weight from label */
    width: 320px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
    z-index: 100;
    margin-bottom: 12px;
    opacity: 0;
    transition: opacity 0.2s, visibility 0.2s;
    line-height: 1.5;
    pointer-events: none;
    /* Prevent tooltip from interfering with hover */
}

/* Tooltip Arrow */
.tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -8px;
    border-width: 8px;
    border-style: solid;
    border-color: var(--white) transparent transparent transparent;
}

/* Tooltip Arrow Border Hook */
.tooltip-content::before {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -9px;
    border-width: 9px;
    border-style: solid;
    border-color: #e0e0e0 transparent transparent transparent;
}

.tooltip-container:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #c9c9c9;
    border-radius: 8px;
    font-size: 15px;
    transition: box-shadow 0.2s, border-color 0.2s;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--focus-ring);
    box-shadow: 0 0 0 2px rgba(178, 102, 255, 0.3);
}

.readonly-input {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    background-color: #f7f7f7;
    color: #666;
}

/* Checkboxes */
.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    gap: 10px;
}

.checkbox-group label {
    margin-bottom: 0;
    font-weight: 400;
    font-size: 14px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--purple-text);
    border-radius: 4px;
    cursor: pointer;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 14px;
    background-color: var(--primary-orange);
    color: var(--white);
    border: 1px solid var(--primary-orange-hover);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-bottom: 25px;
}

.btn-primary:hover {
    background-color: var(--primary-orange-hover);
}

/* Links & Footer Prompts */
.forgot-password {
    text-align: center;
    margin-bottom: 20px;
}

.forgot-password a,
.register-link {
    color: var(--primary-orange);
    text-decoration: underline;
    font-size: 13px;
    font-weight: 600;
}

.register-prompt {
    text-align: center;
    margin-top: 15px;
    font-size: 13px;
}

.separator {
    border-top: 1px solid #ededed;
    padding-top: 25px;
}

/* --- TAN / Sicher Einloggen Styles --- */
.tan-panel {
    display: flex;
    flex-direction: column;
}

.tan-instruction {
    margin-bottom: 25px;
}

.tan-instruction h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.tan-instruction p {
    font-size: 14px;
    color: #333;
}

.tan-input-area {
    width: 100%;
}

/* This row keeps the input and info box side by side */
.tan-input-row {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 25px;
}

.tan-input-wrapper {
    width: 300px;
    /* roughly matches keypad width */
}

.tan-input-wrapper input {
    width: 100%;
    padding: 12px;
    font-size: 20px;
    text-align: left;
    border: 1px solid var(--focus-ring);
    /* On mobile.de, it's purple focused by default */
    border-radius: 8px;
    letter-spacing: 2px;
    box-shadow: 0 0 0 2px rgba(178, 102, 255, 0.1);
}

.tan-info-box {
    flex-shrink: 0;
    /* Prevents shrinking */
    background-color: var(--blue-info);
    border: 1px solid var(--blue-info-border);
    border-radius: 6px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tan-info-box .info-icon-svg {
    width: 18px !important;
    height: 18px !important;
    opacity: 0.8;
}

.info-text {
    font-size: 14px;
    color: var(--purple-text);
    white-space: nowrap;
    line-height: 1;
}

.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 300px;
    gap: 10px;
    margin-bottom: 20px;
}

.key {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--purple-text);
    cursor: pointer;
    transition: background-color 0.1s;
}

.key:hover {
    background-color: #f5f5f5;
}

.key.action-key {
    grid-column: 2 / span 2;
}

.btn-tan {
    width: 300px;
    /* Match keypad width */
}

/* Adjustments for smaller screens */
@media (max-width: 768px) {
    .split-view {
        flex-direction: column;
    }

    .side-blue-block {
        width: 100%;
        min-height: 150px;
        border-radius: 12px 12px 0 0;
        padding: 30px;
    }

    .form-panel {
        width: 100%;
        padding: 30px;
    }

    .tan-input-row {
        flex-direction: column;
    }

    .tan-input-wrapper {
        width: 100%;
        max-width: 300px;
    }

    .tan-info-box {
        width: 100%;
        max-width: 300px;
    }

    .keypad,
    .btn-tan {
        width: 100%;
        max-width: 300px;
    }
}

/* --- Error States --- */
.highlight-border {
    border-color: #b266ff !important;
    /* Purple border for username field in Step 2 */
}

/* Red tag directly under the Username */
.error-label-red {
    display: none;
    background-color: #b32900;
    color: white;
    padding: 10px 15px;
    font-size: 14px;
    border-radius: 4px;
    margin-top: 5px;
    /* Pulls up to connect to input */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    font-weight: 500;
    position: absolute;
    /* Changed to absolute so it doesn't push layout down */
    z-index: 100;
    left: 0;
    right: 0;
}

/* Show the red error label ONLY when hovering over an invalid input */
.input-error:hover+.error-label-red,
.error-label-red:hover {
    display: block !important;
}

/* Pink input background with red border */
.input-error {
    background-color: #FDF1F0 !important;
    border-color: #C9211E !important;
}

/* Pink alert box under Password */
.error-alert-pink {
    background-color: #FDF1F0;
    color: #C9211E;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: -10px;
    /* Bring it closer to input */
    font-weight: 400;
}

/* --- Step 4: Confirmation page --- */
.confirm-data {
    margin: 25px 0;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.confirm-row {
    display: flex;
    padding: 14px 18px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.confirm-row:last-child {
    border-bottom: none;
}

.confirm-label {
    width: 140px;
    font-weight: 700;
    color: #555;
    flex-shrink: 0;
}

.confirm-value {
    color: var(--text-color);
    word-break: break-all;
}

.btn-confirm {
    width: 300px;
    margin-bottom: 15px;
}

.btn-back {
    display: block;
    width: 300px;
    padding: 12px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s;
}

.btn-back:hover {
    background-color: #f5f5f5;
}