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

body {
    font-family: "ivystyle-sans", sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1d1d1f;
    line-height: 1.5;
    padding: 20px 0;
    /* Add padding for long forms on small screens */
}

.container {
    width: 100%;
    max-width: 480px;
    /* Increased width for more fields */
    padding: 20px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.3);
}

.logo-section {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    width: 60px;
    height: 60px;
    margin-bottom: 16px;
    border-radius: 12px;
}

.brand-name {
    font-size: 28px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.tagline {
    font-size: 16px;
    color: #86868b;
    font-weight: 400;
}

.auth-form {
    margin-bottom: 24px;
}

.error-message {
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid rgba(255, 59, 48, 0.2);
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #1d1d1f;
    margin-bottom: 8px;
}

/* Shared styles for all input types */
.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 16px;
    border: 1px solid #d2d2d7;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
    outline: none;
    -webkit-appearance: none;
    /* Removes default OS styling for select */
    appearance: none;
}

.input-group select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 1rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 3rem;
    /* Make space for the arrow */
}

.input-group textarea {
    min-height: 120px;
    resize: vertical;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    border-color: #007aff;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.input-group input::placeholder,
.input-group textarea::placeholder {
    color: #86868b;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 14px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #1d1d1f;
    font-weight: 400;
}

.checkbox-container input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #d2d2d7;
    border-radius: 6px;
    margin-right: 8px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
    /* Prevents shrinking on small screens */
}

.checkbox-container input[type="checkbox"]:checked+.checkmark {
    background: #007aff;
    border-color: #007aff;
}

.checkbox-container input[type="checkbox"]:checked+.checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.form-link {
    color: #007aff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.form-link:hover {
    color: #0056cc;
}

.submit-button {
    width: 100%;
    padding: 16px;
    background: #007aff;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.submit-button:hover {
    background: #0056cc;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 122, 255, 0.3);
}

.submit-button:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.submit-button.loading .button-text {
    opacity: 0;
}

.submit-button.loading .loading-spinner {
    display: flex !important;
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    justify-content: center;
    align-items: center;
}

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

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.prompt {
    text-align: center;
    font-size: 14px;
    color: #86868b;
    margin-top: 24px;
}

/* Responsive Design */
@media (max-width: 480px) {
    .container {
        padding: 16px;
    }

    .auth-card {
        padding: 32px 24px;
    }

    .brand-name {
        font-size: 24px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1d1d1f 0%, #2d2d30 100%);
        color: #f5f5f7;
    }

    .auth-card {
        background: rgba(28, 28, 30, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.2);
    }

    .brand-name,
    .input-group label,
    .checkbox-container {
        color: #f5f5f7;
    }

    .tagline,
    .prompt,
    input::placeholder,
    textarea::placeholder {
        color: #86868b;
    }

    .input-group input,
    .input-group select,
    .input-group textarea {
        background: rgba(58, 58, 60, 0.8);
        border-color: #38383a;
        color: #f5f5f7;
    }

    .input-group input:focus,
    .input-group select:focus,
    .input-group textarea:focus {
        background: rgb(58, 58, 60);
        border-color: #0a84ff;
        box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2);
    }

    .input-group select {
        /*background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");*/
        color: #86868b;
    }

    .checkmark {
        border-color: #545458;
    }

    .checkbox-container input[type="checkbox"]:checked+.checkmark {
        background: #0a84ff;
        border-color: #0a84ff;
    }

    .form-link {
        color: #0a84ff;
    }

    .form-link:hover {
        color: #409cff;
    }

    .submit-button {
        background: #0a84ff;
    }

    .submit-button:hover {
        background: #409cff;
    }
}