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

html {
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, rgba(69, 144, 164, 0.1) 0%, rgba(116, 73, 46, 0.1) 100%),
                url('https://images.unsplash.com/photo-1497435334941-8c899ee9e8e9?w=1920&auto=format&fit=crop') center/cover fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    z-index: -1;
}

/* Header above main card so the company dropdown is not covered (login-wrapper uses transform → stacking context) */
.header {
    position: relative;
    z-index: 100;
    padding: 24px 48px;
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideDown 0.4s ease-out;
}

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

.logo {
    font-size: 48px;
    animation: fadeIn 0.6s ease-out 0.1s both;
}

.logo img {
    max-width: 200px;
    height: auto;
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.header-right {
    display: flex;
    align-items: center;
    animation: fadeIn 0.6s ease-out 0.1s both;
}

/* Company selector — custom dropdown (not native <select>) */
.company-dropdown {
    position: relative;
    min-width: 220px;
    z-index: 0;
}

.company-dropdown.is-open {
    z-index: 200;
}

.company-dropdown__trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    padding: 10px 16px;
    border: 1.5px solid rgba(69, 144, 164, 0.35);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: #0f172a;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.company-dropdown__trigger:hover {
    border-color: rgba(69, 144, 164, 0.65);
    box-shadow: 0 8px 28px rgba(69, 144, 164, 0.12);
}

.company-dropdown__trigger:focus {
    outline: none;
    border-color: rgb(69, 144, 164);
    box-shadow: 0 0 0 4px rgba(69, 144, 164, 0.14);
}

.company-dropdown.is-open .company-dropdown__trigger {
    border-color: rgb(69, 144, 164);
    box-shadow: 0 0 0 4px rgba(69, 144, 164, 0.12);
}

.company-dropdown__label {
    flex: 1;
    text-align: left;
}

.company-dropdown__chev {
    margin-left: auto;
    display: flex;
    align-items: center;
    color: rgb(69, 144, 164);
    transition: transform 0.25s ease;
}

.company-dropdown.is-open .company-dropdown__chev {
    transform: rotate(180deg);
}

.company-dropdown__badge {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: -0.02em;
}

.company-dropdown__badge--group {
    background: linear-gradient(145deg, #10b981 0%, #047857 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.company-dropdown__badge--hospitality {
    background: linear-gradient(145deg, #4590a4 0%, #2a5f6f 100%);
    box-shadow: 0 2px 8px rgba(69, 144, 164, 0.35);
}

.company-dropdown__menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    margin: 0;
    padding: 8px;
    list-style: none;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.14);
    z-index: 2000;
    animation: portalDropdownIn 0.22s ease;
}

.company-dropdown__menu[hidden] {
    display: none !important;
}

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

.company-dropdown__option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.company-dropdown__option:hover {
    background: rgba(69, 144, 164, 0.09);
}

.company-dropdown__option.is-selected {
    background: linear-gradient(135deg, rgba(69, 144, 164, 0.14) 0%, rgba(116, 73, 46, 0.08) 100%);
}

.company-dropdown__opt-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    text-align: left;
}

.company-dropdown__opt-title {
    font-weight: 600;
    font-size: 14px;
    color: #0f172a;
}

.company-dropdown__opt-hint {
    font-size: 12px;
    color: #64748b;
    line-height: 1.35;
}

.company-dropdown__check {
    display: flex;
    align-items: center;
    color: rgb(69, 144, 164);
    opacity: 0;
    transform: scale(0.88);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.company-dropdown__option.is-selected .company-dropdown__check {
    opacity: 1;
    transform: scale(1);
}

/* Main card stacks below header */
.main-container {
    position: relative;
    z-index: 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    padding-top: 15px;
}

.login-wrapper {
    display: flex;
    max-width: 1100px;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    margin: auto;
    animation: fadeInScale 0.5s ease-out 0.2s both;
    will-change: transform, opacity;
}

@keyframes fadeInScale {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Left Side - Hero Image */
.hero-section {
    flex: 1;
    background: linear-gradient(135deg, rgb(69, 144, 164) 0%, rgb(39, 53, 47) 100%);
    padding: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(69, 144, 164, 0.85) 0%, rgba(39, 53, 47, 0.85) 100%);
    z-index: 0;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, 20px); }
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
}

.hero-icon {
    margin: 0 auto 32px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    animation: fadeIn 0.5s ease-out 0.4s both;
    transition: transform 0.3s ease;
    will-change: transform;
}

.hero-icon:hover {
    transform: scale(1.05);
}

.hero-icon img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

@media (max-width: 768px) {
    .hero-icon img {
        max-width: 180px;
        max-height: 80px;
    }
}

@media (max-width: 480px) {
    .hero-icon img {
        max-width: 140px;
        max-height: 60px;
    }
}

.hero-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.3;
    animation: fadeIn 0.5s ease-out 0.5s both;
}

.hero-subtitle {
    font-size: 18px;
    opacity: 0.9;
    font-weight: 400;
    line-height: 1.6;
    animation: fadeIn 0.5s ease-out 0.6s both;
}

/* Right Side - Login Form */
.login-section {
    flex: 1;
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-header {
    margin-bottom: 40px;
    animation: fadeIn 0.5s ease-out 0.4s both;
}

.login-title {
    font-size: 21px;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: #64748b;
    margin-top: 8px;
}

/* Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: fadeIn 0.4s ease-out both;
}

.form-group:nth-child(1) {
    animation-delay: 0.5s;
}

.form-group:nth-child(2) {
    animation-delay: 0.6s;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    color: #1a1a2e;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    background: #f8fafc;
    width: 100%;
}

.form-input:hover {
    border-color: #cbd5e1;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: rgb(69, 144, 164);
    background: white;
    box-shadow: 0 0 0 4px rgba(69, 144, 164, 0.1);
}

.form-input::placeholder {
    color: #94a3b8;
}

.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #64748b;
    font-size: 18px;
    user-select: none;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: rgb(69, 144, 164);
}

.form-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 8px;
    animation: fadeIn 0.4s ease-out 0.7s both;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: rgb(69, 144, 164);
}

.checkbox-label {
    font-size: 14px;
    color: #64748b;
    cursor: pointer;
}

.forgot-link {
    font-size: 14px;
    color: rgb(69, 144, 164);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.forgot-link:hover {
    color: rgb(59, 134, 154);
    text-decoration: underline;
}

.privacy-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 8px;
}

.privacy-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: rgb(69, 144, 164);
}

.privacy-label {
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
}

.privacy-label a {
    color: rgb(69, 144, 164);
    text-decoration: none;
    font-weight: 600;
}

.privacy-label a:hover {
    text-decoration: underline;
}

.login-button {
    padding: 16px 32px;
    background: linear-gradient(135deg, rgb(69, 144, 164) 0%, rgb(116, 73, 46) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 12px;
    animation: fadeIn 0.4s ease-out 0.8s both;
    position: relative;
    will-change: transform;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(69, 144, 164, 0.3);
}

.login-button:active {
    transform: translateY(0);
}

/* Footer */
.footer {
    padding: 24px 48px;
    background: transparent;
    text-align: center;
    animation: fadeIn 0.6s ease-out 0.2s both;
}

.copyright {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 968px) {
    .login-wrapper {
        flex-direction: column;
    }

    .hero-section {
        padding: 40px;
        min-height: 300px;
    }

    .login-section {
        padding: 40px;
    }

    .header, .footer {
        padding: 20px 24px;
    }

    .footer-links {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 16px;
        padding: 16px 20px;
        align-items: stretch;
    }

    .logo {
        text-align: center;
    }

    .logo img {
        max-width: 160px;
        width: 100%;
        height: auto;
    }

    .header-right {
        justify-content: center;
    }

    .company-dropdown {
        min-width: 100%;
        max-width: 100%;
        width: 100%;
    }

    .company-dropdown__trigger {
        min-height: 50px;
        padding: 12px 16px;
        font-size: 14px;
    }

    .main-container {
        padding: 24px 16px;
    }

    .hero-section {
        padding: 32px 24px;
        min-height: 240px;
    }

    .hero-icon {
        font-size: 48px;
        margin-bottom: 24px;
    }

    .hero-title {
        font-size: 26px;
    }

    .hero-subtitle {
        font-size: 15px;
    }

    .login-section {
        padding: 32px 24px;
    }

    .login-title {
        font-size: 20px;
    }

    .login-subtitle {
        font-size: 13px;
    }

    .form-input {
        padding: 14px 16px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .footer {
        padding: 20px 16px;
    }

    .copyright {
        font-size: 12px;
        line-height: 1.5;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 12px 16px;
        gap: 12px;
    }

    .logo img {
        max-width: 140px;
    }

    .company-dropdown__trigger {
        padding: 12px 14px;
        font-size: 14px;
    }

    .main-container {
        padding: 16px 12px;
    }

    .login-wrapper {
        border-radius: 16px;
    }

    .hero-section {
        padding: 24px 20px;
        min-height: 200px;
    }

    .hero-icon {
        font-size: 40px;
        margin-bottom: 20px;
    }

    .hero-title {
        font-size: 22px;
    }

    .hero-subtitle {
        font-size: 14px;
    }

    .login-section {
        padding: 28px 20px;
    }

    .login-header {
        margin-bottom: 28px;
    }

    .login-title {
        font-size: 18px;
    }

    .login-subtitle {
        font-size: 12px;
    }

    .login-form {
        gap: 16px;
    }

    .form-input {
        padding: 12px 16px;
        font-size: 16px;
    }

    .password-toggle {
        right: 14px;
        font-size: 16px;
    }

    .login-button {
        padding: 14px 24px;
        font-size: 15px;
    }

    .footer {
        padding: 16px 12px;
    }

    .copyright {
        font-size: 11px;
    }
}

/* Extra small devices - ensure dropdown is touch-friendly */
@media (max-width: 360px) {
    .company-dropdown__trigger {
        padding: 11px 12px;
        font-size: 13px;
    }

    .company-dropdown__opt-hint {
        font-size: 11px;
    }
}
