* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    color: #111320;
    background: linear-gradient(135deg, #f0f4ff 0%, #ffffff 100%);
    min-height: 100vh;
}

/* =========================
   AUTH WRAPPER
========================= */
.auth-wrapper {
    margin-top: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
    padding: 2rem;
}

.auth-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(26, 86, 255, 0.12);
    overflow: hidden;
    max-width: 500px;
    width: 100%;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =========================
   AUTH HEADER
========================= */
.auth-header {
    background: linear-gradient(135deg, #0d1526 0%, #0f2044 50%, #0a1a3a 100%);
    padding: 3rem 2rem;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.auth-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.auth-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
    color: #ffffff;
    position: relative;
    z-index: 1;
}

.auth-header p {
    color: rgba(255,255,255,0.6);
    font-size: 1rem;
    position: relative;
    z-index: 1;
}

/* =========================
   FORM
========================= */
.form-center {
    padding: 3rem 2.5rem;
}

form { width: 100%; }

.field { margin-bottom: 1.5rem; }

label {
    display: block;
    color: #111320;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
select {
    width: 100%;
    padding: 0.9rem 1.2rem;
    border: 2px solid #e2e6f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.25s ease;
    background: #f7f8fc;
    color: #111320;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus {
    outline: none;
    border-color: #1a56ff;
    background: white;
    box-shadow: 0 0 0 4px rgba(26, 86, 255, 0.1);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231a56ff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-color: #f7f8fc;
    padding-right: 3rem;
}

/* =========================
   COMPANY AUTOCOMPLETE
========================= */
.company-search-wrap {
    position: relative;
}

.company-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 2px solid #1a56ff;
    border-radius: 10px;
    max-height: 220px;
    overflow-y: auto;
    display: none;
    z-index: 50;
    box-shadow: 0 12px 36px rgba(26, 86, 255, 0.15);
}

.company-dropdown.show {
    display: block;
    animation: dropIn 0.2s ease;
}

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.company-option {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #111320;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.15s;
    border-bottom: 1px solid #f0f4ff;
}

.company-option:last-child {
    border-bottom: none;
}

.company-option:hover {
    background: #f0f4ff;
}

.company-option-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    font-weight: 700;
}

.company-option-existing .company-option-icon {
    background: #e8edff;
    color: #1a56ff;
}

.company-option-new .company-option-icon {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.company-option-name {
    flex: 1;
    font-weight: 500;
}

.company-option-tag {
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 5px;
}

.company-option-existing .company-option-tag {
    color: #1a56ff;
    background: #e8edff;
}

.company-option-new .company-option-tag {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

/* Scrollbar */
.company-dropdown::-webkit-scrollbar {
    width: 5px;
}

.company-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.company-dropdown::-webkit-scrollbar-thumb {
    background: #e2e6f0;
    border-radius: 10px;
}

/* Company Status Pill */
.company-status {
    margin-top: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    display: none;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    width: fit-content;
}

.company-status.show {
    display: inline-flex;
}

.company-status.status-existing {
    color: #1a56ff;
    background: #e8edff;
}

.company-status.status-new {
    color: #10b981;
    background: rgba(16, 185, 129, 0.08);
}

/* =========================
   SUBMIT BUTTON
========================= */
input[type="submit"],
.submit {
    width: 100%;
    padding: 1rem;
    background: #1a56ff;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-top: 1rem;
    box-shadow: 0 8px 24px rgba(26, 86, 255, 0.35);
    letter-spacing: 0.2px;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

input[type="submit"]:hover,
.submit:hover {
    background: #4f75ff;
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(26, 86, 255, 0.45);
}

input[type="submit"]:active,
.submit:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(26, 86, 255, 0.3);
}

input[type="submit"]:disabled,
.submit:disabled {
    background: #a0b4ff;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 12px rgba(26, 86, 255, 0.15);
}

/* =========================
   RESULT MESSAGES
========================= */
#result {
    margin-top: 1rem;
    padding: 0;
    text-align: center;
    font-weight: 500;
    font-size: 0.9rem;
    color: #721c24;
    line-height: 1.6;
}

#result:empty {
    display: none;
}

/* =========================
   AUTH FOOTER
========================= */
.auth-footer {
    text-align: center;
    padding: 1.5rem 2.5rem;
    background: #f0f4ff;
    border-top: 2px solid #e2e6f0;
}

.auth-footer p { color: #6b7280; font-size: 0.95rem; }

.auth-footer a {
    color: #1a56ff;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.auth-footer a:hover {
    color: #0f2044;
    text-decoration: underline;
}

/* =========================
   RESPONSIVE — 768px
========================= */
@media (max-width: 768px) {
    .auth-wrapper {
        padding: 1.5rem;
        margin-top: 70px;
    }

    .auth-container {
        border-radius: 16px;
    }

    .auth-header {
        padding: 2.5rem 2rem;
    }

    .auth-header h1 {
        font-size: 1.8rem;
    }

    .form-center {
        padding: 2.5rem 2rem;
    }
}

/* =========================
   RESPONSIVE — 600px
========================= */
@media (max-width: 600px) {
    .auth-wrapper {
        padding: 1rem;
        margin-top: 60px;
        min-height: calc(100vh - 60px);
    }

    .auth-container {
        border-radius: 14px;
        box-shadow: 0 12px 40px rgba(26, 86, 255, 0.1);
    }

    .auth-header {
        padding: 2rem 1.5rem;
    }

    .auth-header h1 {
        font-size: 1.5rem;
    }

    .auth-header p {
        font-size: 0.9rem;
    }

    .form-center {
        padding: 2rem 1.5rem;
    }

    .field {
        margin-bottom: 1.25rem;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    select {
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
    }

    input[type="submit"],
    .submit {
        padding: 0.9rem;
        font-size: 0.95rem;
    }

    .auth-footer {
        padding: 1.25rem 1.5rem;
    }

    .auth-footer p {
        font-size: 0.9rem;
    }

    .company-option {
        padding: 10px 14px;
        font-size: 0.9rem;
    }
}

/* =========================
   RESPONSIVE — 400px
========================= */
@media (max-width: 400px) {
    .auth-wrapper {
        padding: 0.75rem;
        margin-top: 56px;
    }

    .auth-container {
        border-radius: 12px;
    }

    .auth-header {
        padding: 1.5rem 1.25rem;
    }

    .auth-header h1 {
        font-size: 1.3rem;
    }

    .form-center {
        padding: 1.5rem 1.25rem;
    }

    label {
        font-size: 0.85rem;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    select {
        padding: 0.75rem 0.9rem;
        font-size: 0.9rem;
        border-radius: 8px;
    }

    input[type="submit"],
    .submit {
        padding: 0.85rem;
        font-size: 0.9rem;
        border-radius: 8px;
    }

    .company-dropdown {
        border-radius: 8px;
    }
}