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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background-color: #f0f0f0;
    padding: 0;
    margin: 0;
    min-height: 100vh;
}

.page {
    display: block;
}

.page.hidden {
    display: none;
}

/* Login Page Styles */
.container {
    max-width: 400px;
    margin: 20px auto;
    background: white;
    padding: 30px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.container h1 {
    color: #333;
    margin-bottom: 24px;
    font-size: 24px;
    text-align: center;
}

/* Mobile Container for Form Page */
.mobile-container {
    max-width: 100%;
    width: 100%;
    margin: 0;
    background: white;
    padding: 0;
    min-height: 100vh;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    color: #333;
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.logout-btn {
    background-color: #ef4444;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.logout-btn:hover {
    background-color: #dc2626;
}

/* Form Styles */
form {
    padding: 20px;
}

.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    margin-bottom: 6px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

input[type="text"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    background: white;
    transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #3b82f6;
}

textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

/* Property-Unit Section */
.property-unit-section {
    margin-bottom: 24px;
}

#propertyUnitContainer {
    margin-bottom: 16px;
}

.property-unit-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    align-items: center;
}

.property-select {
    flex: 1;
    min-width: 0;
    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='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.unit-input {
    flex: 1;
    min-width: 0;
}

.remove-row-btn {
    background: white;
    color: #6b7280;
    width: 32px;
    height: 32px;
    min-width: 32px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0;
    font-size: 20px;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.remove-row-btn:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

.remove-row-btn.hidden {
    display: none;
}

/* Add Button */
.add-btn {
    background: white;
    color: #000;
    width: 48px;
    height: 48px;
    border: 2px solid #000;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin: 0 auto;
}

.add-btn:hover {
    background-color: #f9fafb;
    transform: scale(1.05);
}

.add-btn svg {
    width: 24px;
    height: 24px;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    background-color: #22c55e;
    color: white;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background-color 0.2s;
    margin-top: 8px;
}

.submit-btn:hover {
    background-color: #16a34a;
}

.submit-btn:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

/* Login Form Submit */
button[type="submit"]:not(.submit-btn) {
    background-color: #3b82f6;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    width: 100%;
    transition: background-color 0.2s;
}

button[type="submit"]:not(.submit-btn):hover {
    background-color: #2563eb;
}

/* Messages */
.error {
    color: #ef4444;
    margin-top: 8px;
    font-size: 13px;
    text-align: center;
}

.message {
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

.message.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.message.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .mobile-container {
        border-radius: 0;
    }

    .header {
        padding: 14px 16px;
    }

    form {
        padding: 16px;
    }

    input[type="text"],
    input[type="password"],
    select,
    textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Larger screens */
@media (min-width: 769px) {
    .mobile-container {
        max-width: 480px;
        margin: 20px auto;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        min-height: auto;
    }

    .header {
        border-radius: 12px 12px 0 0;
    }
}
