/**
 * Registration Interface Stylesheet
 * 
 * Dark-themed design for the Midway registration system.
 * Includes: base form styles, choice page, company & employee pages,
 * success states, validation feedback, and responsive design.
 *
 * Design System:
 * - Background:   #121212
 * - Card:         #222222
 * - Input:        #333333
 * - Accent blue:  #4b6cb7
 * - Success:      #34d399
 * - Error:        #ef4444
 * - Font:         Open Sans
 *
 * @version 3.0 - Consolidated, no inline styles
 */

/* ============================================================================
   FONT IMPORTS
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700&display=swap');

/* ============================================================================
   RESET AND BASE
   ============================================================================ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Open Sans', sans-serif;
}

body {
    background-color: #121212;
    color: #fff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}

/* ============================================================================
   LAYOUT
   ============================================================================ */

.container {
    width: 100%;
    max-width: 550px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-container {
    margin-bottom: 30px;
    text-align: center;
}

.logo-container img {
    max-height: 80px;
    width: auto;
    max-width: 100%;
}

.register-form {
    width: 100%;
    background-color: #222222;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */

h1 {
    font-size: 28px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
}

.page-subtitle {
    color: #999;
    font-size: 14px;
    text-align: center;
    margin-bottom: 28px;
    margin-top: -12px;
}

.section-heading {
    color: #4b6cb7;
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(75, 108, 183, 0.2);
    margin-bottom: 16px;
}

.section-heading i {
    color: #4b6cb7;
}

.section-note {
    color: #888;
    font-size: 13px;
    margin-bottom: 16px;
    margin-top: -8px;
}

.form-divider {
    margin: 28px 0;
    border: none;
    border-top: 1px solid #2a2d3e;
}

/* ============================================================================
   BACK LINK
   ============================================================================ */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #888;
    font-size: 14px;
    text-decoration: none;
    margin-bottom: 20px;
    transition: color 0.2s;
}

.back-link:hover {
    color: #ccc;
}

/* ============================================================================
   CHOICE PAGE — EMPLOYEE vs COMPANY CARDS
   ============================================================================ */

.choice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 28px;
}

.choice-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 30px 20px;
    background-color: #2a2a2a;
    border: 2px solid #333;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    transition: border-color 0.25s ease, background-color 0.25s ease, transform 0.15s ease;
}

.choice-card:hover {
    border-color: #4b6cb7;
    background-color: rgba(75, 108, 183, 0.08);
    transform: translateY(-2px);
}

.choice-card:active {
    transform: translateY(0);
}

.choice-icon {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.choice-card.employee .choice-icon {
    background-color: rgba(52, 211, 153, 0.12);
    color: #34d399;
}

.choice-card.company .choice-icon {
    background-color: rgba(75, 108, 183, 0.15);
    color: #4b6cb7;
}

.choice-card:hover .choice-icon {
    background-color: rgba(75, 108, 183, 0.25);
    color: #4b6cb7;
}

.choice-label {
    font-weight: 600;
    font-size: 15px;
    color: #e0e0e0;
    line-height: 1.3;
}

.choice-sub {
    font-size: 12px;
    color: #888;
    line-height: 1.5;
    margin-top: 4px;
}

/* ============================================================================
   FORM ELEMENTS
   ============================================================================ */

.input-field {
    margin-bottom: 20px;
    position: relative;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #ccc;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
select {
    width: 100%;
    padding: 12px 15px;
    border: none;
    border-radius: 4px;
    background-color: #333;
    color: #fff;
    font-size: 16px;
    transition: all 0.2s ease;
}

input:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(75, 108, 183, 0.5);
    background-color: #3a3a3a;
}

input::placeholder {
    color: #666;
    opacity: 1;
}

input:focus::placeholder {
    color: #777;
}

input + small,
.input-field small {
    display: block;
    margin-top: 5px;
    color: #888;
    font-size: 12px;
}

/* Two-column grid for side-by-side fields */
.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.two-columns .input-field {
    margin-bottom: 0;
}

/* ============================================================================
   PHONE INPUT
   ============================================================================ */

.phone-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.country-code-select {
    width: 120px;
    padding: 12px 10px;
    border: none;
    border-radius: 4px;
    background-color: #333;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.country-code-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(75, 108, 183, 0.5);
    background-color: #3a3a3a;
}

.phone-input-wrapper input[type="tel"] {
    flex: 1;
    margin: 0;
}

/* ============================================================================
   PASSWORD INPUT
   ============================================================================ */

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 45px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 20px;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: #4b6cb7;
}

/* ============================================================================
   PASSWORD STRENGTH
   ============================================================================ */

.password-strength {
    margin-top: 10px;
    margin-bottom: 15px;
}

.strength-bar {
    height: 4px;
    background: #333;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.strength-bar-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-text {
    font-size: 12px;
    color: #999;
}

/* ============================================================================
   PASSWORD REQUIREMENTS
   ============================================================================ */

.password-requirements {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.requirement {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #999;
    transition: color 0.2s;
}

.requirement i {
    font-size: 16px;
    color: #ef4444;
    transition: color 0.2s;
}

.requirement.met {
    color: #34d399;
}

.requirement.met i {
    color: #34d399;
}

/* ============================================================================
   VALIDATION FEEDBACK
   ============================================================================ */

.validation-feedback {
    margin-top: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 20px;
}

.validation-feedback.success {
    color: #34d399;
}

.validation-feedback.error {
    color: #ef4444;
}

.validation-feedback.checking {
    color: #fbbf24;
}

.validation-feedback i {
    font-size: 16px;
}

/* ============================================================================
   USERNAME SUGGESTIONS
   ============================================================================ */

.username-suggestions {
    margin-top: 10px;
}

.suggestion-btn {
    display: inline-block;
    background: #333;
    color: #4b6cb7;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid #444;
    margin: 4px 4px 0 0;
    transition: all 0.2s ease;
}

.suggestion-btn:hover {
    background: #444;
    border-color: #4b6cb7;
    transform: translateY(-1px);
}

/* ============================================================================
   COMPANY VERIFICATION STATUS BADGE
   ============================================================================ */

.company-verified-badge {
    display: none;
    padding: 12px 16px;
    border-radius: 8px;
    background-color: rgba(52, 211, 153, 0.1);
    border: 1px solid #34d399;
    margin-bottom: 20px;
    align-items: center;
    gap: 10px;
}

.company-verified-badge.visible {
    display: flex;
}

.company-verified-badge i {
    color: #34d399;
    font-size: 20px;
    flex-shrink: 0;
}

.company-verified-badge span {
    color: #34d399;
    font-weight: 600;
    font-size: 14px;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn-primary {
    width: 100%;
    padding: 14px;
    background-color: #4b6cb7;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-primary:hover {
    background-color: #3b5998;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(75, 108, 183, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background-color: #555;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    display: inline-block;
    width: 100%;
    padding: 12px;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    text-align: center;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: #444;
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: translateY(0);
}

.return-home-btn {
    display: block;
    width: 100%;
    margin-top: 25px;
    padding: 12px;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    text-align: center;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.return-home-btn:hover {
    background-color: #444;
    transform: translateY(-1px);
}

.return-home-btn:active {
    transform: translateY(0);
}

/* ============================================================================
   SEPARATOR & ACCOUNT LINKS
   ============================================================================ */

.separator {
    position: relative;
    text-align: center;
    margin: 30px 0;
}

.separator::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #444;
}

.separator span {
    position: relative;
    background-color: #222;
    padding: 0 15px;
    color: #999;
    font-size: 14px;
}

.account-links {
    margin-top: 25px;
    text-align: center;
}

.account-links p {
    margin-bottom: 15px;
    color: #ccc;
    font-size: 16px;
}

/* ============================================================================
   MESSAGES
   ============================================================================ */

.success-message {
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    background-color: rgba(52, 211, 153, 0.2);
    color: #34d399;
    border-left: 4px solid #34d399;
}

.error-message {
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    background-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-left: 4px solid #ef4444;
}

/* ============================================================================
   SUCCESS PAGE — compact, no-scroll, centered design
   ============================================================================ */

.registration-success-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px 0 4px;
    gap: 16px;
}

/* Icon circle — small and refined, not oversized */
.success-icon-wrap {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(75, 181, 67, 0.12);
    border: 2px solid rgba(75, 181, 67, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-icon-wrap i {
    font-size: 34px;
    color: #4bb543;
}

.success-icon-wrap.warning {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.4);
}

.success-icon-wrap.warning i { color: #ffc107; }

.success-icon-wrap.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.4);
}

.success-icon-wrap.error i { color: #ef4444; }

@keyframes popIn {
    from { transform: scale(0.5); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

/* Title */
.success-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

/* Subtitle line under title */
.success-subtitle {
    font-size: 14px;
    color: #999;
    margin: -8px 0 0;
    line-height: 1.5;
}

/* Email pill */
.email-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 14px;
    color: #e0e0e0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-pill i {
    color: #4b6cb7;
    font-size: 16px;
    flex-shrink: 0;
}

/* Info card — replaces the big yellow box */
.success-info-card {
    width: 100%;
    background: #2a2a2a;
    border-radius: 10px;
    padding: 16px 20px;
    text-align: left;
    border-left: 3px solid #4b6cb7;
}

.success-info-card p {
    font-size: 13px;
    color: #ccc;
    margin: 0;
    line-height: 1.6;
}

.success-info-card p + p {
    margin-top: 6px;
}

/* Spam note */
.spam-note {
    font-size: 12px;
    color: #666;
    margin: 0;
}

.spam-note a {
    color: #4b6cb7;
    text-decoration: none;
}

/* Action button row */
.action-buttons {
    margin-top: 4px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
}

.action-buttons .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: auto;
    min-width: 160px;
    justify-content: center;
}

/* Keep old classes as no-ops so nothing breaks if referenced elsewhere */
.success-icon { display: none; }
.success-message-large { display: none; }
.action-required-box   { display: none; }
.helpful-tips          { display: none; }
.next-steps-box        { display: none; }
.step-progress         { display: none; }
.email-highlight       { display: none; }

/* ============================================================================
   TOOLTIP
   ============================================================================ */

.tooltip-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    color: #4b6cb7;
    font-size: 18px;
    transition: all 0.3s ease;
    z-index: 10;
}

.tooltip-icon:hover {
    color: #667eea;
    transform: scale(1.1);
}

.tooltip-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    background: #333;
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: normal;
    white-space: normal;
    width: 280px;
    max-width: 280px;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    line-height: 1.5;
    border: 1px solid #444;
}

.tooltip-icon::before {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(5px);
    border: 6px solid transparent;
    border-right-color: #333;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1001;
}

.tooltip-icon:hover::after,
.tooltip-icon:hover::before {
    opacity: 1;
    visibility: visible;
}

.tooltip-icon:hover::after  { transform: translateY(-50%) translateX(15px); }
.tooltip-icon:hover::before { transform: translateY(-50%) translateX(10px); }

.tooltip-icon.clickable { cursor: pointer; }

.tooltip-icon.clickable.active::after,
.tooltip-icon.clickable.active::before {
    opacity: 1;
    visibility: visible;
}

.tooltip-icon.clickable.active::after  { transform: translateY(-50%) translateX(15px); }
.tooltip-icon.clickable.active::before { transform: translateY(-50%) translateX(10px); }

/* ============================================================================
   CHARACTER COUNTER
   ============================================================================ */

.char-counter {
    float: right;
    font-size: 0.85em;
    color: #999;
    font-weight: normal;
}

/* ============================================================================
   MODAL
   ============================================================================ */

.success-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #222;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.modal-icon {
    color: #4bb543;
    font-size: 48px;
    margin-bottom: 20px;
}

.modal-content h2 { margin-bottom: 15px; font-size: 24px; }
.modal-content p  { margin-bottom: 25px; color: #ccc; }

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-login-btn,
.modal-close-btn {
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
}

.modal-login-btn { background-color: #4b6cb7; color: white; }
.modal-login-btn:hover { background-color: #3b5998; }

.modal-close-btn { background-color: #333; color: white; }
.modal-close-btn:hover { background-color: #444; }

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeInUp 0.35s ease;
}

/* ============================================================================
   RESPONSIVE — TABLET
   ============================================================================ */

@media (max-width: 768px) {
    .container {
        max-width: 100%;
        padding: 15px;
    }

    .register-form {
        padding: 25px 20px;
    }

    h1 { font-size: 24px; }

    .tooltip-icon::after {
        left: 50%;
        right: auto;
        top: 100%;
        transform: translateX(-50%) translateY(10px);
        width: 250px;
        max-width: calc(100vw - 40px);
    }

    .tooltip-icon::before {
        left: 50%;
        right: auto;
        top: 100%;
        transform: translateX(-50%) translateY(5px) rotate(90deg);
        border-right-color: transparent;
        border-bottom-color: #333;
    }

    .tooltip-icon:hover::after  { transform: translateX(-50%) translateY(15px); }
    .tooltip-icon:hover::before { transform: translateX(-50%) translateY(10px) rotate(90deg); }

    .tooltip-icon.clickable.active::after  { transform: translateX(-50%) translateY(15px); }
    .tooltip-icon.clickable.active::before { transform: translateX(-50%) translateY(10px) rotate(90deg); }
}

/* ============================================================================
   RESPONSIVE — MOBILE
   ============================================================================ */

@media (max-width: 576px) {
    body { padding: 10px 0; }

    .container { padding: 10px; }

    .register-form {
        padding: 20px 16px;
        border-radius: 16px;
    }

    h1 { font-size: 22px; margin-bottom: 16px; }

    .two-columns {
        grid-template-columns: 1fr;
        gap: 0;
        margin-bottom: 0;
    }

    .two-columns .input-field { margin-bottom: 20px; }

    .input-field input,
    .input-field select {
        font-size: 16px;
        padding: 14px 15px;
        border-radius: 8px;
    }

    .btn-primary {
        padding: 16px;
        font-size: 16px;
        border-radius: 12px;
    }

    .btn-primary:active  { transform: scale(0.98); }
    .btn-secondary:active { transform: scale(0.98); background-color: #444; }

    .btn-secondary {
        padding: 12px;
        border-radius: 12px;
        font-size: 16px;
    }

    .account-links {
        margin-top: 20px;
        padding-top: 20px;
        border-top: 1px solid #444;
    }

    .account-links p { font-size: 14px; margin-bottom: 12px; }

    .separator { margin: 25px 0; }

    .modal-content { padding: 25px 20px; width: 95%; }
    .modal-icon { font-size: 40px; }
    .modal-content h2 { font-size: 20px; }

    .modal-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .modal-login-btn,
    .modal-close-btn {
        width: 100%;
        padding: 12px;
    }

    .phone-input-wrapper { flex-direction: row; }
    .country-code-select { width: 100px; font-size: 14px; }

    /* Choice page — stack cards vertically on mobile */
    .choice-grid { grid-template-columns: 1fr; }

    .choice-card {
        flex-direction: row;
        text-align: left;
        padding: 20px;
        gap: 16px;
    }

    .choice-icon { flex-shrink: 0; }

    /* Success page */
    .success-icon { font-size: 56px; }
    .success-message-large p { font-size: 14px; }
    .step-progress { gap: 12px; }
    .progress-step { padding: 12px; gap: 12px; }
    .step-number { width: 36px; height: 36px; font-size: 16px; }
    .step-info strong { font-size: 14px; }
    .step-info span   { font-size: 12px; }
    .action-required-box { padding: 16px; }
    .action-required-box i { font-size: 40px; }
    .action-required-box h4 { font-size: 16px; }
    .email-highlight { font-size: 14px; word-break: break-all; }

    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .action-buttons .btn-secondary {
        width: 100%;
        min-width: 100%;
    }
}

/* ============================================================================
   VERY SMALL DEVICES
   ============================================================================ */

@media (max-width: 360px) {
    .register-form { padding: 16px 12px; }
    h1 { font-size: 20px; }
}

/* ============================================================================
   REDUCED MOTION
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}