* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Work Sans', sans-serif;
    background-color: #ffffff;
    margin: 0;
    padding: 0;
    position: relative;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Spacer to push footer down if content is short */
.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 20px;
    padding-bottom: 20px;
    flex: 1;
}

/* Footer Styles */
.page-footer {
    width: 100%;
    border-top: 1px solid #e5e7eb;
    padding: 24px 20px;
    background-color: #ffffff;
    font-size: 12px;
    color: #666666;
    margin-top: 0; /* Changed from auto - normal flow */
    position: relative;
    z-index: 1;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (min-width: 768px) {
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }
}

.footer-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-logo {
    width: 150px;
    height: auto;
    margin-bottom: 8px;
}

.footer-text {
    line-height: 1.5;
}

.footer-right {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-shrink: 0;
}

/* Seal images */
.seal-img {
    height: auto;
    object-fit: contain;
    /* Removed border */
}

/* Specific widths for seals to match visual hierarchy */
.seal-cace {
    width: 140px;
}

.seal-aaip {
    width: 60px;
}

.seal-qr {
    width: 35px;
}

.login-container {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

@media (max-width: 768px) {
    .login-container {
        max-width: 100%;
        padding: 0 16px;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 0 12px;
    }
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 24px;
}

.logo {
    max-width: 325px;
    height: auto;
    display: block;
    width: 100%;
}

.welcome-message {
    font-size: 24px;
    line-height: 32px;
    font-weight: bold;
    font-family: 'Work Sans', sans-serif;
    color: rgb(36, 36, 51);
    text-align: center;
    margin-bottom: 32px;
}

.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 0; /* Button will handle its own margin */
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 16px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 8px;
    display: block;
}

.form-input {
    width: 100%;
    padding: 12px 18px;
    font-size: 18px;
    font-family: inherit;
    border: 1px solid #767676;
    border-radius: 8px;
    background-color: #ffffff;
    color: #333333;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    margin-top: 4px;
}

/* Select dropdown styling */
select.form-input {
    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='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
    cursor: pointer;
}

.form-input:focus {
    border-color: #4285f4;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

.form-input::placeholder {
    color: #9ca3af;
}

.login-button {
    width: 100%;
    color: rgb(255, 255, 255);
    background-color: rgb(135, 30, 227);
    border: none;
    max-height: 48px;
    padding: 12px 24px;
    display: flex;
    position: relative; /* Normal relative positioning */
    justify-content: center;
    gap: 4px;
    align-items: center;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.2s;
    font-size: 18px;
    font-weight: 600;
    font-family: inherit;
    margin-top: 8px;
    margin-bottom: 0;
    /* Ensure button is in normal document flow */
    transform: none;
    top: auto;
    bottom: auto;
    left: auto;
    right: auto;
}

.login-button:hover {
    background-color: #7b22d3;
}

.login-button:active {
    background-color: #6a1b9a;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    body {
        padding: 0;
        display: flex; /* Keep flex for centering on mobile */
        justify-content: center;
        align-items: center;
    }

    .main-content {
        padding: 20px 16px;
        padding-bottom: 40px;
        justify-content: flex-start;
    }

    .login-container {
        max-width: 100%;
        width: 100%;
        padding: 0;
    }

    .logo {
        max-width: 200px;
        width: 100%;
        height: auto;
    }

    .welcome-message {
        font-size: 20px;
        line-height: 28px;
        margin-bottom: 24px;
    }

    .login-form {
        gap: 20px;
        margin-bottom: 0;
    }

    .form-input {
        font-size: 16px;
        padding: 14px 16px;
        min-height: 48px; /* Better touch target */
    }

    select.form-input {
        padding-right: 40px;
        background-position: right 12px center;
    }

    .payment-label {
        font-size: 13px;
    }

    .login-button {
        width: 100%;
        position: relative !important;
        margin-top: 24px;
        margin-bottom: 20px;
        transform: none !important;
        top: auto !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
    }

    /* Footer adjustments for mobile */
    .page-footer {
        padding: 20px 16px;
        margin-top: 0; /* Remove margin since button has margin-bottom */
    }

    .footer-content {
        flex-direction: column;
        gap: 16px;
    }

    .footer-left {
        width: 100%;
    }

    .footer-logo {
        width: 120px;
    }

    .footer-text {
        font-size: 11px;
        line-height: 1.4;
    }

    .footer-right {
        flex-wrap: wrap;
        gap: 10px;
        justify-content: flex-start;
    }

    .seal-cace {
        width: 100px;
    }

    .seal-aaip {
        width: 50px;
    }

    .seal-qr {
        width: 30px;
    }

    /* Billing address specific responsive */
    .form-group[style*="flex"] {
        flex-direction: column !important;
    }

    /* Payment page responsive */
    .expiry-container {
        flex-wrap: wrap;
    }

    .expiry-select {
        width: 100%;
        max-width: 120px;
    }

    /* Card selector responsive */
    .card-selector {
        justify-content: center;
        flex-wrap: wrap;
    }

    /* Form row responsive (for province/zip) */
    .form-row {
        flex-direction: column !important;
        gap: 16px !important;
    }

    .form-row .form-group {
        flex: 1 !important;
        width: 100% !important;
    }

    /* Remove inline width styles on mobile */
    .form-input[style*="width"],
    select[style*="width"] {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Payment page specific */
    .expiry-container {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .expiry-select {
        width: 100% !important;
        max-width: 200px !important;
    }

    .expiry-container span {
        display: none; /* Hide "/" separator on mobile */
    }

    /* Ensure all buttons have proper spacing above footer */
    .login-button,
    .done-button {
        margin-bottom: 40px !important;
    }
}

@media (max-width: 480px) {
    body {
        display: block; /* Natural block flow */
    }

    .main-content {
        padding: 16px 12px;
        padding-bottom: 40px;
        justify-content: flex-start;
    }

    .login-container {
        padding: 0;
    }

    .logo {
        max-width: 180px;
    }

    .welcome-message {
        font-size: 18px;
        line-height: 24px;
        margin-bottom: 20px;
    }

    .login-form {
        gap: 16px;
        margin-bottom: 0;
    }

    .form-label {
        font-size: 14px;
    }

    .form-input {
        font-size: 16px;
        padding: 12px 14px;
        min-height: 44px; /* Better touch target on small screens */
    }

    select.form-input {
        padding-right: 36px;
        background-position: right 10px center;
    }

    .payment-label {
        font-size: 12px;
    }

    .login-button {
        font-size: 16px;
        padding: 14px 20px;
        margin-top: 20px;
        margin-bottom: 20px;
    }

    .page-footer {
        padding: 16px 12px;
        margin-top: 0;
    }

    .footer-text {
        font-size: 10px;
    }
}