:root {
    --brand-primary: #111;
    --brand-blue: #7ac0e4;
    --brand-blue-light: #7ac0e433;
    --danger-color: #dc3545;
    --success-color: #00C853;
    --success-bg-color: rgba(0, 200, 83, 0.1);
    --danger-bg-color: rgba(255, 76, 76, 0.1);
    --text-primary: #111;
    --text-secondary: #888;
    --border-color: #eee;
    --background-color: #fff;
    --font-family-main: 'Inter', 'Massilia', Arial, sans-serif;
    --font-family-light: 'Inter', 'Massilia Light', Arial, sans-serif;
}

body {
    margin: 0;
    font-family: var(--font-family-main);
}

h2 {
    font-weight: 700;
    font-size: 2.2rem;
    letter-spacing: -0.02em;
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 2rem;
    margin-top: 0.5rem;
}

.login-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.phone-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.fellow-input-group {
    position: relative;
}

.fellow-input-group input,
.custom-select-selected {
    width: 100%;
    padding: 16px;
    font-size: 18px;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--background-color) !important;
    /* Important needed for input */
    outline: none;
    font-family: var(--font-family-light);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.fellow-input-group input:focus,
.custom-select-container.open .custom-select-selected {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 2px var(--brand-blue-light);
}

.fellow-input-group input::placeholder {
    color: transparent;
}

.fellow-input-group label {
    position: absolute;
    left: 12px;
    top: 16px;
    padding: 0 6px;
    font-family: var(--font-family-light);
    font-size: 18px;
    color: var(--text-secondary);
    pointer-events: none;
    transition: all 0.2s ease;
    border-radius: 4px;
    background: var(--background-color);
}

.fellow-input-group input:focus+label,
.fellow-input-group input:not(:placeholder-shown)+label,
.fellow-input-group .custom-select-container.open+label,
.fellow-input-group .custom-select-container.has-value+label {
    top: -10px;
    font-size: 14px;
    color: var(--brand-primary);
}

.fellow-input-group input:focus+label,
.fellow-input-group .custom-select-container.open+label {
    color: var(--brand-blue);
}

/* --- Custom Select Styles --- */
.custom-select-container {
    position: relative;
}

.custom-select-selected {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-secondary);
}

.custom-select-selected span {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.custom-select-arrow {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--text-secondary);
    transition: transform 0.2s ease;
}

.custom-select-container.open .custom-select-arrow {
    transform: rotate(180deg);
}

.custom-select-options {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--background-color);
    border: 1.5px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
}

.custom-select-container.open .custom-select-options {
    display: block;
}

.custom-select-option {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-family-light);
    font-size: 18px;
}

.custom-select-option:hover {
    background-color: #f4eadb;
}

.custom-select-option img,
.custom-select-selected img {
    width: 24px;
    height: auto;
}

/* --- End Custom Select --- */

/* --- Validation & Feedback --- */
.fellow-input-group input.is-invalid {
    border-color: var(--danger-color) !important;
    box-shadow: 0 0 0 1px var(--danger-color) !important;
}

.invalid-feedback {
    display: block;
    color: var(--danger-color);
    font-size: 14px;
    margin-top: 4px;
    font-family: 'Massilia Light';
    text-align: left;
}

.fellow-input-group label.label-error {
    color: var(--danger-color) !important;
}

.response-message {
    font-family: 'Massilia Light';
    font-size: 14px;
    padding: 8px;
    border-radius: 4px;
    /* Using var(--Border-Radius-SM) would be better if defined */
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    margin-top: 0.5rem;
}

.response-message.visible {
    opacity: 1;
    visibility: visible;
}

.response-message.error {
    background-color: var(--danger-bg-color);
    color: var(--danger-color);
}

.response-message.success {
    background-color: var(--success-bg-color);
    color: var(--success-color);
}

/* --- Verification & Display --- */
.verification-section,
#identifierDisplayWrapper {
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.verification-section.visible,
#identifierDisplayWrapper.visible {
    display: block;
    /* or flex for identifierDisplayWrapper */
    opacity: 1;
    transform: translateY(0);
}

#identifierDisplayWrapper.visible {
    display: flex;
}


.verification-hint {
    font-family: 'Massilia Light';
    font-size: 14px;
    color: var(--brand-primary);
    opacity: 0.7;
    margin-top: 0.5rem;
    text-align: center;
}

#verificationCode {
    letter-spacing: 0.5em;
    text-align: center;
    font-size: 20px;
}

#identifierDisplayWrapper {
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 2rem;
}

@media (max-width: 576px) {
    #identifierDisplayWrapper {
        margin-bottom: 1.25rem;
    }
}

#identifierDisplay {
    font-family: var(--font-family-main);
    font-weight: 700;
    font-size: 1.8rem;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--brand-primary);
    word-break: normal;
    overflow-wrap: anywhere;
    max-width: 100%;
    display: block;
    white-space: normal;
}

#editIdentifierBtn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: opacity 0.2s;
    opacity: 0.85;
}

#editIdentifierBtn svg {
    width: 32px;
    height: 32px;
    display: block;
}

#editIdentifierBtn:hover {
    opacity: 1;
}

/* --- Buttons & Spinners --- */
.btn-primary-fellow {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--brand-primary);
    color: var(--background-color);
    border: none;
    border-radius: 16px;
    padding: 12px 0;
    font-family: 'Inter', Arial, sans-serif;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.03em;
    transition: all 0.3s ease;
    width: 100%;
    gap: 8px;
}

.btn-primary-fellow:hover,
.btn-primary-fellow:focus {
    background-color: var(--brand-primary);
    color: var(--background-color);
}

.btn-primary-fellow:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid var(--background-color);
    border-top: 2.5px solid var(--success-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    background: transparent;
    margin-left: 8px;
}

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

/* --- Utility --- */
.hidden {
    display: none !important;
}

/* --- Responsive --- */
@media (max-width: 576px) {
    #identifierDisplay {
        font-size: 1.1rem;
        max-width: 95vw;
    }

    .login-container {
        padding: 24px 24px 8px 24px;
        width: 100%;
    }

    h2 {
        font-size: 28px;
        margin-bottom: 1.5rem;
    }

    .fellow-input-group input:not(:placeholder-shown)+label,
    .fellow-input-group input:focus+label,
    .fellow-input-group .custom-select-container.open+label,
    .fellow-input-group .custom-select-container.has-value+label {
        font-size: 12px;
    }
}

/* --- Scroll Hint --- */
@-webkit-keyframes bounce-hint {

    0%,
    100% {
        -webkit-transform: rotate(45deg) translateY(0);
        transform: rotate(45deg) translateY(0);
        opacity: 0.7;
    }

    50% {
        -webkit-transform: rotate(45deg) translateY(6px);
        transform: rotate(45deg) translateY(6px);
        opacity: 1;
    }
}

@keyframes bounce-hint {

    0%,
    100% {
        transform: rotate(45deg) translateY(0);
        opacity: 0.7;
    }

    50% {
        transform: rotate(45deg) translateY(6px);
        opacity: 1;
    }
}

.scroll-hint-arrow {
    display: block;
    -webkit-animation: bounce-hint 1.2s ease-in-out infinite;
    animation: bounce-hint 1.2s ease-in-out infinite;
}

/* --- App Showcase Alternative Layout --- */

.scroll-bounce {
    animation: bounce-down 2s infinite;
}

@keyframes bounce-down {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(10px);
    }
    60% {
        transform: translateY(5px);
    }
}

.showcase-section {
    background-color: #fcfcfc;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.showcase-row {
    margin-bottom: 8rem !important;
}

.showcase-row:last-child {
    margin-bottom: 3rem !important;
}

.showcase-img {
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(0,0,0,0.08);
    cursor: zoom-in;
    -webkit-user-drag: none;
    user-select: none;
    image-rendering: auto;
}

.showcase-img:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12) !important;
}

.showcase-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(17, 17, 17, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 3vw, 40px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.showcase-lightbox.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.showcase-lightbox-image {
    max-width: min(1200px, 92vw);
    max-height: 88vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
    cursor: zoom-out;
    image-rendering: auto;
}

.showcase-lightbox-close {
    position: absolute;
    top: max(16px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.92);
    color: #111;
    font-size: 28px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

@media (max-width: 991.98px) {
    .showcase-lightbox-image {
        max-width: 96vw;
        max-height: 82vh;
    }
}

/* Enhancing typography for the showcase headers */
.showcase-section h3.display-6 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    color: #111;
}

.showcase-section p.text-secondary {
    font-size: 1.15rem;
    color: #555 !important;
}

/* Mobile adjustments for Showcase */
@media (max-width: 991.98px) {
    .showcase-row {
        margin-bottom: 3rem !important;
        padding-bottom: 0 !important;
    }
    
    .showcase-img {
        max-height: 400px !important;
        margin-top: 1.5rem;
    }
    
    .showcase-section h3.display-6 {
        font-size: 1.75rem;
    }
    
    .showcase-section p.text-secondary {
        font-size: 1rem;
    }
}

/* Footer Styles */
.footer-link {
    transition: color 0.2s ease, transform 0.2s ease;
    display: inline-block;
}

.footer-link:hover {
    color: var(--brand-blue) !important;
    transform: translateX(4px);
}

.social-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
}

.social-icon-link:hover {
    background-color: #e9ecef;
}

.social-icon-link:hover img,
.social-icon-link:hover svg {
    opacity: 1 !important;
    color: var(--brand-blue);
}

.social-bg-brand {
    background-color: #6f42c1 !important;
}

.social-bg-brand:hover {
    background-color: #59339d !important;
}

.social-bg-brand img {
    filter: brightness(0) invert(1);
    opacity: 1 !important;
}

.social-bg-dark {
    background-color: #111 !important;
}

.social-bg-dark:hover {
    background-color: #333 !important;
}

.social-bg-dark svg {
    color: #fff !important;
    opacity: 1 !important;
}