/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #E31937 0%, #B01530 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #333;
}

.container {
    width: 100%;
    max-width: 500px;
}

/* Card styles */
.card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* Logo styles */
.logo-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.logo-header img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.logo-header img[alt="Xero"] {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.logo-divider {
    width: 2px;
    height: 30px;
    background: #e2e8f0;
}

/* Hide divider when Sniip logo is not displayed */
.logo-header img[style*="display: none"] + .logo-divider,
.logo-header img:not([src*="sniip"]) ~ .logo-divider:first-of-type {
    display: none;
}

h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1a202c;
}

.subtitle {
    color: #718096;
    margin-bottom: 32px;
    font-size: 14px;
}

/* Form styles */
.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #4a5568;
    font-size: 14px;
}

input[type="email"],
input[type="password"],
select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    font-family: inherit;
}

input[type="email"]:focus,
input[type="password"]:focus,
select:focus {
    outline: none;
    border-color: #E31937;
    box-shadow: 0 0 0 3px rgba(227, 25, 55, 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='%234a5568' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* Button styles */
.btn {
    width: 100%;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #E31937 0%, #B01530 100%);
    color: white;
    margin-bottom: 12px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(227, 25, 55, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.btn-danger {
    background: #f56565;
    color: white;
    margin-bottom: 12px;
}

.btn-danger:hover {
    background: #e53e3e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.4);
}

/* Radio group styles */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.radio-card {
    display: block;
    position: relative;
    cursor: pointer;
}

.radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.radio-content {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s;
}

.radio-card input[type="radio"]:checked + .radio-content {
    border-color: #E31937;
    background: #fef2f4;
}

.radio-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 4px;
}

.radio-content p {
    font-size: 14px;
    color: #718096;
    margin: 0;
}

/* Error message */
.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 16px;
    font-size: 14px;
}

/* Status section */
.status-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

.status-item:last-child {
    border-bottom: none;
}

.status-item .label {
    font-weight: 600;
    color: #4a5568;
}

.status-item .value {
    color: #1a202c;
}

.status-item .value.success {
    color: #38a169;
    font-weight: 600;
}

.status-item .value.error {
    color: #e53e3e;
    font-weight: 600;
}

#statusContent {
    margin-bottom: 32px;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-overlay p {
    color: white;
    margin-top: 16px;
    font-size: 16px;
}

/* Spinner animation */
.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Connection type container */
.connection-type-container {
    margin-bottom: 24px;
}

/* Connection cards */
.connection-card {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    background: #f7fafc;
}

.connection-card:last-child {
    margin-bottom: 24px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 12px;
    margin-top: 12px;
}

/* Responsive */
@media (max-width: 600px) {
    .card {
        padding: 24px;
    }

    h1 {
        font-size: 24px;
    }

    .connection-card {
        padding: 16px;
    }
}
